Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a test system that will be run by others. It will have some kernel mods, and some of the default software in /usr/bin will be replaced. Because of this, I want to prevent the users from doing "sudo apt-get update" or "sudo apt-get install". These systems will not have any valuable data, and will mostly be behind corporate firewalls, and thus it is safe to completely punt on security-based releases.

FWIW, moving apt-* and dpkg* to /usr/dontusethese does not work because some other processes like (gag) MOTD updating relies on them being in /usr/bin and whine if they are not there.

share|improve this question
up vote 8 down vote accepted

Just configure /etc/sudoers appropriately so that only authorized users can run apt-get.

share|improve this answer
Doh, or that would work just as well as my response. – peelman Oct 14 '10 at 18:44
Prohibiting users from doing an action is a better solution than masking the update action by removing the repositories. – Chris Oct 14 '10 at 18:55
To close the loop, since people like recipes, here is what works well: "adminuser ALL = NOPASSWD: ALL, !/usr/bin/apt*, !/usr/bin/dpkg*" – Paul Hoffman Oct 16 '10 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.