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.

As the solution to another problem I was forced to use dpkg --remove to uninstall a package. However, after I do this the package is still listed in dpkg -l:

phrogz@planar:/boot$ dpkg -l | grep linux-image-2
ii  linux-image-2.6.32-30-server  2.6.32-30.59  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-31-server  2.6.32-31.61  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-32-server  2.6.32-32.62  Linux kernel image for version 2.6.32 on x86

phrogz@planar:/boot$ sudo dpkg --remove linux-image-2.6.32-30-server
(Reading database ... 141902 files and directories currently installed.)
Removing linux-image-2.6.32-30-server ...
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
[...]
done

phrogz@planar:/boot$ dpkg -l | grep linux-image-2
rc  linux-image-2.6.32-30-server  2.6.32-30.59  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-31-server  2.6.32-31.61  Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-32-server  2.6.32-32.62  Linux kernel image for version 2.6.32 on x86

phrogz@planar:/boot$ sudo apt-get --purge remove linux-image-2.6.32-30-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-image-2.6.32-30-server is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How can I 'clean house' so that dpkg-l no longer lists these older, non-existent packages?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Run

sudo dpkg --purge <package>

or

sudo apt-get purge <package>

to uninstall <package> AND its configuration files.

share|improve this answer

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.