Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there anyway to disable/remove apt-get on a debian based server. I'd prefer to use aptitude, and don't want the other users to be installing packages with apt-get, to avoid package/database issues.

share|improve this question
add comment

5 Answers

up vote 18 down vote accepted

There are no issues with people using both tools at the same time. I frequently install things using apt-get or aptitude from the command line or use the curses interface to do security updates. Both apt-get and aptitude are front-ends to libapt-pkg, which deals with the dependency resolving and fetching of packages. libapt-pkg in turn uses dpkg to do the actual package installation. Both dpkg and libapt-pkg does locking in the right place, so that if someone is running aptitude, someone else can't install a package via apt-get until aptitude closes.

Since apt-get auto-dependency support there is no advantage of one tool over the other[0]

[0] except aptitude doesn't have super cow powers.

share|improve this answer
1  
I see, I was under the impression they were maintaining seperate package databases, thanks for the clarification. –  DeadlyCreampuff Oct 6 '09 at 2:52
    
aptitude used to contain extra data about whether a package was automatically installed or not, but I hear that's now changed and it's all the same database. –  Teddy Oct 11 '09 at 5:44
    
Indeed, hence the comment about apt-get's "auto-dependency" support. –  David Pashley Oct 11 '09 at 7:19
add comment

You could do:

chmod 0 /usr/bin/apt-get
share|improve this answer
    
Not sure why this got voted down - it would work .. –  pjc50 Oct 6 '09 at 9:28
3  
pjc50: Because it's a bad idea. –  duskwuff Oct 11 '09 at 6:54
add comment

There are numerious places that Ubuntu officially suggests using apt-get, rgrep apt-get /usr/lib/python2.6/dist-packages/DistUpgrade to see it. Removing apt-get, or changing the permissions on it can be problematic for debian utilities that might make the relative safe assumption it is there.

share|improve this answer
add comment

The idea that there is no difference between apt-get and aptitude is absurd. Yes, they deal with the same repositories but do so in much different ways. Without getting too much into detail, adding packages is about the same, but if you ever want to remove a package or change things, you cannot mix the two and expect good results.

Search for "aptitude vs apt-get" on your favorite search engine for detailed articles about differences.

That being said, you can add this to your /root/.bashrc file:

alias apt-get="echo 'Please use aptitude on this system.'"

Then:

source /root/.bashrc

share|improve this answer
add comment

There are plenty of ways you can do it, but the fact that your users are able to install packages implies that they have root-level access.

If they have root, you must remember that anything root can do, root can undo (in this context anyway).

All that being said, I'd say the "safest" way to do it is to delete (but keep a copy of) the sources.list file in /etc/apt.

That way all the different variations of apt-get (like aptitude and who knows what else) will fail to work. It's also (marginally) harder for users to reconstruct that than to undo a "chmod 0" of a specific command.

share|improve this answer
    
It appears that he doesn't mind others installing things, he just wants them to use aptitude only for installs. –  Zoredache Oct 5 '09 at 21:36
    
Wow, I totally missed the "I'd prefer to use aptitude" part. My apologies. –  Some Guy Oct 5 '09 at 21:56
add comment

Your Answer

 
discard

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.