LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-27-2007, 08:28 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Remove dependencies when removing a package


Hi,

Suppose I would like to remove gcc from my Debian system. Generally the way I remove is:

Code:
dpkg --purge gcc
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
 
Old 06-27-2007, 08:33 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
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.
 
Old 06-28-2007, 02:42 AM   #3
war1025
Member
 
Registered: Jul 2006
Distribution: Debian: Squeeze AMD64
Posts: 318

Rep: Reputation: 32
apt-get remove gcc

I'm pretty sure that removes dependencies as well.
 
Old 06-28-2007, 06:11 AM   #4
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
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.
 
Old 06-28-2007, 12:48 PM   #5
war1025
Member
 
Registered: Jul 2006
Distribution: Debian: Squeeze AMD64
Posts: 318

Rep: Reputation: 32
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.
 
Old 06-28-2007, 01:12 PM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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
 
Old 06-28-2007, 02:53 PM   #7
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 60
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing dependencies in Packages ? ashrafzia Linux - Software 3 06-11-2006 12:29 AM
Removing unneeded old dependencies pulsez Fedora 5 09-16-2005 01:18 AM
removing package with unmet dependencies in Sarge killy9999 Debian 6 09-08-2005 12:42 PM
apt not removing dependencies JetJock Debian 11 06-18-2005 02:09 AM
apt-get remove and dependencies wrongman Debian 3 05-21-2004 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration