top | item 11229944

(no title)

adricnet | 10 years ago

Only one of them requires readwrite system administrator privileges (eg sudo). apt-cache can be run by any user as it doesn't expose any secret data and can't be used to make changes. apt-get can install and uninstall software as well as download packages and thus needs root privileges in the classic UNIX model.

discuss

order

CydeWeys|10 years ago

apt-get doesn't fail when run as non-root, it only fails when you run it as non-root when you try to some of the commands that require root privileges (such as installing system level packages). It has lots of commands that don't need root privileges. I don't see much reason why "list all the packages available for installation", as well as the other commands in apt-cache, aren't included in that list.

pherq|10 years ago

apt-get source works fine without super-user privileges, so it isn't just that some have to be run as root.

krylon|10 years ago

On CentOS, I can do "yum search something" as a regular user, while "yum install something" or "yum upgrade" require root privileges.

I think it's similar with the pkg command on FreeBSD.

konfou|10 years ago

and same with pacman on Arch (and derivatives)