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 installed a package by mistake and immediately removed (purged it to be exact) it, but other than the package itself, none of the dependencies that installed alongside was removed. I do not know if it's required or not, but if no, I would like to remove them.

share|improve this question
    
Can you indicate which package you installed? –  enzotib Sep 24 '11 at 11:53
    
ubuntu-applet-session on minimal install. –  Oxwivi Sep 24 '11 at 12:03
    
There is no such package, do you mean indicator-applet-session? Anyway I would have an answer if it was a metapackage, but it is not. –  enzotib Sep 24 '11 at 12:30
    
Sorry, I have no idea how I misplaced indicator with ubuntu, but yes that's the package in question. –  Oxwivi Sep 24 '11 at 12:31
add comment

2 Answers 2

up vote 2 down vote accepted

man apt-get provides information that the parameter autoremove is used to remove packages that were automatically downloaded to satisfy dependencies for some package and are no longer required.

So, you could use sudo apt-get autoremove to remove dependencies that are now useless.

Additional source: Ubuntugeek

share|improve this answer
    
I know about that, but usually it says at the end of an apt-get install/remove process that there are some packages that needs to be removed. But after installing the package in question I only removed it, and no mentioned of orphaned packages. –  Oxwivi Sep 24 '11 at 11:40
    
This is the tricky bit, the packages came a dependency of package x (I'm naming it for convenience), but they did not become orphaned after package x was removed. –  Oxwivi Sep 24 '11 at 11:41
    
so it's very probable that they are being used by a different application. –  nitstorm Sep 24 '11 at 11:44
    
But how? Like I said, I removed package x immediately, I did not install any other packages that may have those dependencies. –  Oxwivi Sep 24 '11 at 11:45
add comment

If apt-get's autoremove doesn't help, you can run this (needs aptitude, takes very long, like an hour! - no idea if this can be done faster):

for i in $(dpkg -l  | grep "^ii" | awk '{print $2}'); do aptitude why "$i"; done | grep "Unable to find"

This will list all packages which aptitude can find no reason why they are installed (but you maybe installed them manually).

share|improve this answer
    
Gah, I need to do that for a few packages...? –  Oxwivi Sep 24 '11 at 12:02
    
You can - or wait for a better answer. ;) –  htorque Sep 24 '11 at 12:11
    
Any apt-get equivalent? –  Oxwivi Sep 24 '11 at 12:25
    
I don't know anything else than autoremove. Can't you take a look at your dpkg history in Ubuntu Software Center or Synaptic? –  htorque Sep 24 '11 at 12:26
    
Minimal install. Oh right, maybe I should consider installing either of them but currently it's only a command line. –  Oxwivi Sep 24 '11 at 12:33
show 1 more 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.