Help cleaning up apt/dpkg after deleting installed files
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you look at the top of the full dpkg -l listing you'll see...
Code:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-============================-====================================-============================================
So "ii" would mean "Desired=Install, Status=Installed". You can probably remove the package by forcing a re-installation of it then doing a normal remove --purge or a forced remove.
Distribution: Linux Mint KDE (and playing w/ sidux)
Posts: 4
Original Poster
Rep:
Here's the output:
Code:
$ dpkg -l "linux-image*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=========================-=========================-==================================================================
un linux-image <none> (no description available)
un linux-image-2.6 <none> (no description available)
un linux-image-2.6-sidux-686 <none> (no description available)
ii linux-image-2.6.32-2.slh. 2.6.32-16 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-6.slh. 2.6.32-30 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-6.slh. 2.6.32-31 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-7.slh. 2.6.32-32 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-7.slh. 2.6.32-36 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-7.slh. 2.6.32-38 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.32-8.slh. 2.6.32-40 Linux 2.6.32 image on PPro/Celeron/PII/PIII/P4
ii linux-image-2.6.33-0.slh. 2.6.33-3 Linux 2.6.33 for modern PCs
ii linux-image-2.6.33-0.slh. 2.6.33-4 Linux 2.6.33 for modern PCs
And here's what's in /boot:
Code:
$ ls -l /boot
total 53543
-rw-r--r-- 1 root root 105491 Feb 12 21:04 config-2.6.32-8.slh.2-sidux-686
-rw-r--r-- 1 root root 110178 Feb 25 13:40 config-2.6.33-0.slh.3-sidux-686
-rw-r--r-- 1 root root 110178 Feb 27 17:08 config-2.6.33-0.slh.4-sidux-686
drwxr-xr-x 3 root root 6144 Mar 3 16:43 grub
-rw-r--r-- 1 root root 10179043 Feb 18 12:01 initrd.img-2.6.32-8.slh.2-sidux-686
-rw-r--r-- 1 root root 10603791 Mar 3 15:57 initrd.img-2.6.33-0.slh.3-sidux-686
-rw-r--r-- 1 root root 10598704 Mar 8 19:33 initrd.img-2.6.33-0.slh.4-sidux-686
-rw-r--r-- 1 root root 10601783 Mar 3 16:43 initrd.img-2.6.33-0.slh.4-sidux-686.bak
drwx------ 2 root root 12288 Jan 26 16:06 lost+found
-rw-r--r-- 1 root root 160284 Jan 27 12:33 memtest86+.bin
-rw-r--r-- 1 root root 162464 Jan 27 12:33 memtest86+_multiboot.bin
lrwxrwxrwx 1 root root 10 Nov 10 19:58 message -> message.hd
-rw-r--r-- 1 root root 370688 Oct 29 18:45 message.hd
-rw-r--r-- 1 root root 370688 Oct 29 18:45 message.live
-rw-r--r-- 1 root root 1234552 Feb 12 21:04 System.map-2.6.32-8.slh.2-sidux-686
-rw-r--r-- 1 root root 1253858 Feb 25 13:40 System.map-2.6.33-0.slh.3-sidux-686
-rw-r--r-- 1 root root 1251277 Feb 27 17:08 System.map-2.6.33-0.slh.4-sidux-686
-rw-r--r-- 1 root root 2465088 Feb 12 21:04 vmlinuz-2.6.32-8.slh.2-sidux-686
-rw-r--r-- 1 root root 2493696 Feb 25 13:40 vmlinuz-2.6.33-0.slh.3-sidux-686
-rw-r--r-- 1 root root 2495904 Feb 27 17:08 vmlinuz-2.6.33-0.slh.4-sidux-686
Distribution: Linux Mint KDE (and playing w/ sidux)
Posts: 4
Original Poster
Rep:
Well I didn't bother w/ the grep before because I didn't think showing the extra 3 lines which didn't start w/ ii would matter much.
OK, here's the results piped to grep, but now you've got to explain this to me!
How is it that the output is different? How did the package name get truncated? I expect grep to get the same lines written to the console and filter those, but that obviously didn't happen!?
Code:
$ dpkg -l "linux-image*" | grep ^ii
ii linux-image-2.6.32-2.slh.4-sidux-686 2.6.32-16 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-6.slh.3-sidux-686 2.6.32-30 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-6.slh.4-sidux-686 2.6.32-31 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.1-sidux-686 2.6.32-32 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.5-sidux-686 2.6.32-36 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.7-sidux-686 2.6.32-38 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-8.slh.2-sidux-686 2.6.32-40 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.33-0.slh.3-sidux-686 2.6.33-3 Linux 2.6.33 for modern PCs
ii linux-image-2.6.33-0.slh.4-sidux-686 2.6.33-4 Linux 2.6.33 for modern PCs
Now that I see that the package name is different than what I was trying to remove, I'll try again.
That seemed to work.
Code:
# apt-get remove --purge linux-image-2.6.32-2.slh.4-sidux-686
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-2.6.32-2.slh.4-sidux-686*
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 83.5MB disk space will be freed.
(Reading database ... 234959 files and directories currently installed.)
Removing linux-image-2.6.32-2.slh.4-sidux-686 ...
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.33-0.slh.4-sidux-686
Found initrd image: /boot/initrd.img-2.6.33-0.slh.4-sidux-686
Found linux image: /boot/vmlinuz-2.6.33-0.slh.3-sidux-686
Found initrd image: /boot/initrd.img-2.6.33-0.slh.3-sidux-686
Found linux image: /boot/vmlinuz-2.6.32-8.slh.2-sidux-686
Found initrd image: /boot/initrd.img-2.6.32-8.slh.2-sidux-686
Found memtest86+ image: /memtest86+_multiboot.bin
done
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.32-2.slh.4-sidux-686 /boot/vmlinuz-2.6.32-2.slh.4-sidux-686
Purging configuration files for linux-image-2.6.32-2.slh.4-sidux-686 ...
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.33-0.slh.4-sidux-686
Found initrd image: /boot/initrd.img-2.6.33-0.slh.4-sidux-686
Found linux image: /boot/vmlinuz-2.6.33-0.slh.3-sidux-686
Found initrd image: /boot/initrd.img-2.6.33-0.slh.3-sidux-686
Found linux image: /boot/vmlinuz-2.6.32-8.slh.2-sidux-686
Found initrd image: /boot/initrd.img-2.6.32-8.slh.2-sidux-686
Found memtest86+ image: /memtest86+_multiboot.bin
done
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.32-2.slh.4-sidux-686 /boot/vmlinuz-2.6.32-2.slh.4-sidux-686
rmdir: failed to remove `/lib/modules/2.6.32-2.slh.4-sidux-686': Directory not empty
# dpkg -l "linux-image*" | grep ^ii
ii linux-image-2.6.32-6.slh.3-sidux-686 2.6.32-30 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-6.slh.4-sidux-686 2.6.32-31 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.1-sidux-686 2.6.32-32 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.5-sidux-686 2.6.32-36 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-7.slh.7-sidux-686 2.6.32-38 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.32-8.slh.2-sidux-686 2.6.32-40 Linux 2.6.32 image on PPro/Celeron/PII/PIII/
ii linux-image-2.6.33-0.slh.3-sidux-686 2.6.33-3 Linux 2.6.33 for modern PCs
ii linux-image-2.6.33-0.slh.4-sidux-686 2.6.33-4 Linux 2.6.33 for modern PCs
In a terminal dpkg checks how many columns there are and tries to adjust the output. This type of thing does not happen when you pipe to grep. You can also set the COLUMNS env variable (NB. this just my understanding, not a definitive statement).
For example compare the output from the following two commands.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.