apt-get purge

Derek Broughton derek at pointerstop.ca
Tue Jan 6 18:52:35 UTC 2009

Alex Katebi wrote:

>   Well I did try to remove the wrong package. But when it asked me about
> removing all other packages I thought that it is trying to clean uneeded
> packages not vital ones.

Unfortunately, from a linux point-of-view, those weren't vital - they were 
only your Desktop packages :-)  The command line would still work... 
>   gdm was borken because of readline5. I could not open a terminal. I
>   would say that it is essential.

Neither would KDE or any X app, but I suppose the real key to "essential" is 
that without the essential packages, it's impossible (or at least 
exceedingly difficult) to recover.  In your case, if you'd had a list of 
previously installed packages, you could still have reinstalled them from 
the command line (in fact, there's a fairly good chance that "sudo dpkg -i 
/var/cache/apt/archives/*" would have done the job).  Alternatively, do you 
realize you should (I've never actually tried it) be able to parse out 
everything you just deleted from /var/log/dpkg.log?

# egrep "[0123456789d- :]+ remove" /var/log/dpkg.log

should find all the recently removed packages - find where the first removed 
package is (I'm not 100% sure it will be libreadline5) and delete everything 
before that, then pipe the rest through 
> cut -f 4 -d " " | dpkg --set-selections

Of course, as I said, I haven't tried this :-)

More information about the ubuntu-users mailing list