cannot remove linux-image-extra-4.10.0-37-generic
Hi,
I am trying to remove the old kernel linux-image-
[...]
After this operation, 132 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 285641 files and directories currently installed.)
Removing linux-image-
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
[...]
Nothing happens afterwards, apt is locked and I have to reboot. All installs/upgrades fail due to that issue.
I am running artful, upgraded from zesty.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu apt Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- actionparsnip
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
For diagnostic purposes please provide the output that you receive for the commands
uname -a
lsb_release -crid
dpkg -l | grep ' linux-i'
df -h
ls -l /boot
sudo dpkg --audit
Revision history for this message
|
#2 |
Here are the requested outputs. The packages not installed yet (winusb and woeusb) seem to fail due to the failing of the remove.
$ uname -a
Linux G-thor 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:04:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful
$ dpkg -l | grep 'linux-i'
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rH linux-image-
ii linux-image-
ii linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
ii linux-image-generic 4.13.0.17.18 amd64 Generic Linux kernel image
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 7,8G 0 7,8G 0% /dev
tmpfs 1,6G 19M 1,6G 2% /run
/dev/mapper/
tmpfs 7,8G 18M 7,8G 1% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/loop0 84M 84M 0 100% /snap/core/3247
/dev/loop1 68M 68M 0 100% /snap/asunder-
/dev/loop2 84M 84M 0 100% /snap/core/3440
/dev/loop3 84M 84M 0 100% /snap/core/3017
/dev/sdb2 473M 230M 219M 52% /boot
/dev/sdb1 511M 4,6M 507M 1% /boot/efi
tmpfs 1,6G 12K 1,6G 1% /run/user/128
tmpfs 1,6G 44K 1,6G 1% /run/user/1000
/home/MY_
/dev/sdd1 7,5G 40M 7,5G 1% /media/
$ ls -l /boot
total 224923
-rw-r--r-- 1 root root 1443962 Okt 6 21:45 abi-4.10.
-rw-r--r-- 1 root root 1500286 Okt 11 19:33 abi-4.13.
-rw-r--r-- 1 root root 1500314 Nov 1 16:17 abi-4.13.
-rw-r--r-- 1 root root 204962 Okt 6 21:45 config-
-rw-r--r-- 1 root root 213028 Okt 11 19:33 config-
-rw-r--r-- 1 root root 213028 Nov 1 16:17 config-
drwx------ 3 root root 4096 Jan 1 1970 efi
drwxr-xr-x 5 root root 1024 Nov 25 11:59 grub
-rw-r--r-- 1 root root 52514759 Okt 21 11:05 initrd.
-rw-r--r-- 1 root root 60454081 Nov 11 08:56 initrd.
-rw-r--r-- 1 root root 60450128 Nov 24 13:21 initrd.
drwx------ 2 root root 12288 Okt 30 2016 lost+found
-rw-r--r-- 1 root root 182704 Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 Jan 28 2016 memtest86+
-rw------- 1 root root 3722207 Okt 6 21:45 System.
-rw------- 1 root root 3878463 Okt 11 19:33 System.
-rw------- 1 root root 3881480 Nov 1 16:17 System.
-rw------- 1 root root 7583504 Okt 6 21:45 vmlinuz-
-rw------- 1 root root 7812880 Okt 11 19:33 vmlinuz-
-rw------- 1 root root 7814808 Okt 21 11:06 vmlinuz-
-rw------- 1 root root 7816976 Nov 1 16:17 vmlinuz-
-rw------- 1 root root 7818904 Nov 24 13:21 vmlinuz-
$ sudo dpkg --audit
[sudo] password for philip:
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
winusb WinUSB dummy package
woeusb WoeUSB can create bootable windows installer on usb.
The following packages are only half installed, due to problems during
installation. The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
linux-
Revision history for this message
|
#3 |
Try
sudo apt-get install --reinstall linux-image-
and report the results
Revision history for this message
|
#4 |
$ sudo apt-get install --reinstall linux-image-
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of woeusb:
woeusb depends on libwxbase3.0-0v5 (>= 3.0.3.1+dfsg2); however:
Package libwxbase3.0-0v5 is not installed.
woeusb depends on libwxgtk3.0-0v5 (>= 3.0.3.1+dfsg2); however:
Package libwxgtk3.0-0v5 is not installed.
woeusb depends on grub-pc-bin; however:
Package grub-pc-bin is not installed.
dpkg: error processing package woeusb (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of winusb:
winusb depends on woeusb; however:
Package woeusb is not configured yet.
dpkg: error processing package winusb (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
woeusb
winusb
sudo apt-get install --reinstall linux-image-
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of linux-image-
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
woeusb : Depends: libwxbase3.0-0v5 (>= 3.0.3.1+dfsg2) but it is not going to be installed
Depends: libwxgtk3.0-0v5 (>= 3.0.3.1+dfsg2) but it is not going to be installed
Depends: grub-pc-bin
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
grub-pc-bin libwxbase3.0-0v5 libwxgtk3.0-0v5
Suggested packages:
desktop-base
The following packages will be REMOVED:
linux-
The following NEW packages will be installed:
grub-pc-bin libwxbase3.0-0v5 libwxgtk3.0-0v5
0 upgraded, 3 newly installed, 1 to remove and 31 not upgraded.
3 not fully installed or removed.
Need to get 0 B/6.033 kB of archives.
After this operation, 132 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 285641 files and directories currently installed.)
Removing linux-image-
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
Progress: [ 4%] [######
Same result. But I'm asking myself why the error "Reinstallation of linux-image-
Revision history for this message
|
#5 |
You can tidy up with:
sudo dpkg -P `dpkg -l | grep ^rc | awk {'print $2'}`
All the lines starting 'rc' are removed but have residual configurations. The command will clean those up for you.
Revision history for this message
|
#6 |
For the problem with woeusb and winusb:
are these packages really necessary?
For "Reinstallation of linux-image-
what is the output of
ls -l /var/cache/
Revision history for this message
|
#7 |
woeusb and winusb are not necessary, these are two packages i tried to install (via deb) for another reason, but had a dependency (grub-pc-bin). When I tried to install grub-pc-bin the package linux-image-
$ sudo ls -l /var/cache/
ls: cannot access '/var/cache/
@actionbarsnip: what does this line really do? dpkg -l | grep ^rc gives a really long list with lots of packages including all kernel versions but also other stuff like php7, findbugs or docker-engine
Revision history for this message
|
#8 |
The packages aren't installed. They are the residual configuration files and files the packages generated by the package but not part of the package itself. If you reinstall the package then the files will be used again. It's incase you need them or want to reinstall the package and keep previous configuration.
You don't need them and cleaning up is good. The installed kernels and other packages start their lines with 'ii' and will not be touched
Revision history for this message
|
#9 |
You can avoid having to do this by adding the option
--purge
When you use apt-get. Eg (don't run this. It's just an example):
sudo apt-get --purge remove firefox
It doesn't remove configurations from your user's $HOME folder but the stuff installing a package created during installation is removed.
Revision history for this message
|
#10 |
Thank you very much, both actionparsnip and Manfred!
$ sudo dpkg -P `dpkg -l | grep ^rc | awk {'print $2'}`
$ sudo dpkg -r winusb woeusb
$ sudo apt-get autoremove
Finally updating is possible again!
Revision history for this message
|
#11 |
Thanks actionparsnip, that solved my question.