Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-27-2007, 08:28 PM
|
#1
|
Senior Member
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249
Rep:
|
Remove dependencies when removing a package
Hi,
Suppose I would like to remove gcc from my Debian system. Generally the way I remove is:
Now this will generally remove the package, but how can I remove the other dependencies which got installed when I had installed the gcc package by:
Code:
apt-get install gcc
Is there any way to know what are the dependencies of a particular package?
Thanks
|
|
|
06-27-2007, 08:33 PM
|
#2
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep: 
|
If you used Aptitude instead of apt-get it would track that for you..
http://www.garfieldtech.com/blog/your-debian-aptitude
Quote:
More importantly, aptitude supports two-way dependency tracking. That is, if you install package A which requires package B, then remove package A, aptitude will check to see if anything else you've installed recently requires B. If not, it will let you know that B is now a waste of disk space and will be removed; no need to play with deborphan or debfoster. It only works if you used aptitude to install the packages in the first place, but if you just stick to aptitude then it's much easier than remembering to install debfoster on every system.
|
http://www.psychocats.net/ubuntu/aptitude
since you have not been using aptitude you could use deborphan
http://www.debian-administration.org/articles/134
I would suggest moving forward you abandon dpkp and apt-get and switch to aptitude.
aptitude update
aptitude keep-all
should be the first two commands you run if you decide to switch.
You can use the Debian package search to determine the dependancies of a package..
http://www.debian.org/distrib/packages
http://packages.debian.org/stable/devel/gcc
Last edited by farslayer; 06-27-2007 at 08:34 PM.
|
|
|
06-28-2007, 02:42 AM
|
#3
|
Member
Registered: Jul 2006
Distribution: Debian: Squeeze AMD64
Posts: 318
Rep:
|
apt-get remove gcc
I'm pretty sure that removes dependencies as well.
|
|
|
06-28-2007, 06:11 AM
|
#4
|
Member
Registered: May 2007
Distribution: Debian
Posts: 754
Rep:
|
Quote:
Originally Posted by war1025
apt-get remove gcc
I'm pretty sure that removes dependencies as well.
|
It doesn't. Apt-get remove (or even purge) only removes (or purges) the original package, not dependencies. The newest version of apt adds the autoremove feature, but in a different way than aptitude (the new apt is in Unstable and Experimental, I believe, not yet in Testing or Stable). In aptitude if you remove the original package, the dependencies are automatically removed by default along with it. You only enter one command. In apt-get 7.x (the new versions), you need to enter two commands: first, apt-get remove packagename; then apt-get autoremove.
Bottom line: "apt-get remove gcc" doesn't remove dependencies.
|
|
|
06-28-2007, 12:48 PM
|
#5
|
Member
Registered: Jul 2006
Distribution: Debian: Squeeze AMD64
Posts: 318
Rep:
|
well I was having troubles with libgpod the other day (it won't read or write to ipod's properly) so I did apt-get remove libgpod and it removed gtkpod and rhythmbox too.
I guess that is the other way around. It removes programs that depend on it... nevermind then I guess.
|
|
|
06-28-2007, 01:12 PM
|
#6
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
You should really use aptitude!
The only thing I haven't found is the equivalent of
apt-get source <package>
I haven't even read the manpage maybe that's why 
|
|
|
06-28-2007, 02:53 PM
|
#7
|
Member
Registered: May 2007
Distribution: Debian
Posts: 754
Rep:
|
Quote:
Originally Posted by war1025
well I was having troubles with libgpod the other day (it won't read or write to ipod's properly) so I did apt-get remove libgpod and it removed gtkpod and rhythmbox too.
I guess that is the other way around. It removes programs that depend on it... nevermind then I guess.
|
Right, if package x (libgpod) is required by package y (gtkpod) and you remove package x, then package y is automatically removed. But with apt-get it doesn't work the other way around.
Quote:
Originally Posted by nx5000
The only thing I haven't found is the equivalent of
apt-get source <package>
|
Yeah, I think that's right. Aptitude doesn't do source. It's too bad, since sometimes it's useful.
|
|
|
All times are GMT -5. The time now is 12:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|