Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to install a package (DigiKam), but it has a lot of dependencies. If I decide I no longer need this software and uninstall it, will the now unnessary dependencies be removed?

If not, how can I do it manually?

share|improve this question
add comment

5 Answers 5

up vote 30 down vote accepted

You can use the command apt-get autoremove. It will remove packages that are installed as automatic dependencies, but are not depended anymore.

Apt-get has a flag --auto-remove that can be used to automatically remove the automatically installed packages when removing a manually installed package:

apt-get remove --auto-remove packagename

Certain other tools are also capable of doing this, for example aptitude will automatically suggest that you remove the packages that have been orphaned.

The automatically installed packages tracking is built in to apt so the tracking should work no matter which tool you use to install the packages.

share|improve this answer
    
Beat me to it. :) –  jumpnett Jul 29 '10 at 20:57
    
By just mere seconds =) –  Ressu Jul 29 '10 at 21:01
    
So, the answer would be that it is NOT done automatically on removing the "parent" package, right ? –  jfoucher Jul 29 '10 at 21:12
    
It depends on the method you use to remove the parent package. For example aptitude suggests that those packages are removed when you uninstall the parent package. Not all tools do this though. –  Ressu Jul 30 '10 at 6:08
    
You can remove a package and all of its now-no-longer-needed dependencies in one step with sudo apt-get remove --auto-remove package. –  Marius Gedminas Jul 30 '10 at 11:58
show 3 more comments
sudo apt-get remove --auto-remove 

Only run this.

Install BleachBit from Software Center. When you clean ur system using it, BleachBit will automatically run this command to clean the apt cache.

share|improve this answer
add comment

The Computer Janitor, in the system menu can do this too.

share|improve this answer
    
+1 for actually using the computer janitor! –  jfoucher Aug 5 '10 at 6:13
add comment

I use ubuntu tweak, it has a very effecient app cleaning utility that has never removed more then it should.

share|improve this answer
add comment
aptitude purge digikam
deborphan
aptitude purge `deborphan`

deborphan lists packages which are not used or do not depend. So you can safely uninstall them. I tend to use purge as option of aptitude because it removes also config files and other stuff.

share|improve this answer
    
When using deborphan it is often necessary to run it a few times in a row, or at least it was in my experience with it. It seemed to continue to find new stuff. –  mfisch Jul 30 '10 at 2:58
    
Yep, that's right. Someone wrote an improvement to deborphan. But that never made its way into Debian. The algorithm was better and you had it to run only once. Maybe I'd ask the author if he wants to add it again to Debian/Ubuntu repos. –  qbi Jul 30 '10 at 12:07
    
Maybe I cannot use it, but deborphan usually wants to remove many applications that I actually use, as well as some important system packages. –  Rafał Cieślak Aug 25 '11 at 18:38
    
aptitude purge <pkgname> is very useful for completely obliterating packages that have had a failed/partially successful uninstallation. Their status may be listed by dpkg -L <pkgname> as deinstall but using aptitude will remove them completely from aptitude's database, and lingering files not removed by the failed installation seemed to be removed too. –  KomodoDave Mar 12 '13 at 16:50
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.