First time posting here since I've usually been able to go around and fix my issues with help of google, but this time I think I'm in a bit of a pickle.
I have a VPS running on DigitalOcean which I use for personal projects. I had it set up a long time ago, I think it was even pre-installed by DO for me, possibly. It's running Ubuntu 14.04 so I decided it's time to upgrade it - big mistake.
I ran some casual updates with sudo apt-get update && sudo apt-get upgrade
Before running sudo do-release-upgrade
.
At one of these the problems started - it seems that apt-get remove
is not able to remove old kernel version? But I might be misreading the information absolutely since, sadly, I am not that proficient with Linux updates.
I will try to list all of the command outputs I've read might be useful. Any tips on how to get out of this mess are appreciated.
df -hT
output:
root@web:~# df -hT
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 487M 4.0K 487M 1% /dev
tmpfs tmpfs 100M 344K 100M 1% /run
/dev/vda1 ext4 20G 4.7G 14G 25% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 497M 0 497M 0% /run/shm
none tmpfs 100M 0 100M 0% /run/user
Seems I'm good with the space on the server
sudo apt-get autoremove
& sudo apt-get remove --purge --auto-remove
output:
root@web:~# sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-image-3.13.0-79-generic : Depends: initramfs-tools (>= 0.36ubuntu6) but it is not installed
Recommends: grub-pc or
grub-efi-amd64 or
grub-efi-ia32 or
grub but it is not installed or
lilo (>= 19.1) but it is not installed
linux-image-3.13.0-83-generic : Depends: initramfs-tools (>= 0.36ubuntu6) but it is not installed
Recommends: grub-pc or
grub-efi-amd64 or
grub-efi-ia32 or
grub but it is not installed or
lilo (>= 19.1) but it is not installed
E: Unmet dependencies. Try using -f.
autoremove with fix flag:
root@web:~# sudo apt-get -f autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
bash-completion cloud-guest-utils coreutils dpkg ifupdown
init-system-helpers initramfs-tools initramfs-tools-bin initramfs-tools-core
initscripts klibc-utils libalgorithm-diff-xs-perl libapparmor-perl libblkid1
libdbd-mysql-perl libdbi-perl libfdisk1 libfile-fcntllock-perl libgcrypt20
libgpg-error0 libklibc liblocale-gettext-perl libmount1 libmysqlclient20
libncurses5 libncursesw5 libperl5.22 libselinux1 libsmartcols1
libsub-name-perl libsystemd0 libtext-charwidth-perl libtext-iconv-perl
libtinfo5 libudev1 lsb-base perl perl-base perl-modules-5.22 rename
sysvinit-utils udev util-linux
Suggested packages:
rdnssd libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl
rng-tools perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
bootlogd sash kbd console-tools util-linux-locales
The following packages will be REMOVED:
libterm-readkey-perl libtext-soundex-perl linux-headers-3.13.0-79
linux-headers-3.13.0-79-generic linux-image-3.13.0-79-generic
linux-image-extra-3.13.0-79-generic mysql-client-5.5 perl-modules
The following NEW packages will be installed:
initramfs-tools initramfs-tools-core libfdisk1 libgcrypt20 libmysqlclient20
libperl5.22 libsmartcols1 libsystemd0 perl-modules-5.22 rename udev
The following packages will be upgraded:
bash-completion cloud-guest-utils coreutils dpkg ifupdown
init-system-helpers initramfs-tools-bin initscripts klibc-utils
libalgorithm-diff-xs-perl libapparmor-perl libblkid1 libdbd-mysql-perl
libdbi-perl libfile-fcntllock-perl libgpg-error0 libklibc
liblocale-gettext-perl libmount1 libncurses5 libncursesw5 libselinux1
libsub-name-perl libtext-charwidth-perl libtext-iconv-perl libtinfo5
libudev1 lsb-base perl perl-base sysvinit-utils util-linux
32 upgraded, 11 newly installed, 8 to remove and 277 not upgraded.
4 not fully installed or removed.
Need to get 0 B/16.2 MB of archives.
After this operation, 279 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Extracting templates from packages: 100%
(Reading database ... 143659 files and directories currently installed.)
Removing linux-image-extra-3.13.0-79-generic (3.13.0-79.123) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-79-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
/etc/kernel/postinst.d/initramfs-tools: 33: /etc/kernel/postinst.d/initramfs-tools: update-initramfs: not found
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-79-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-79-generic (3.13.0-79.123) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
/etc/kernel/postrm.d/initramfs-tools: 33: /etc/kernel/postrm.d/initramfs-tools: update-initramfs: not found
run-parts: /etc/kernel/postrm.d/initramfs-tools exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-79-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-79-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-79-generic
linux-image-3.13.0-79-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get -f install
output:
root@web:~# sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
bash-completion cloud-guest-utils coreutils dpkg ifupdown
init-system-helpers initramfs-tools initramfs-tools-bin initramfs-tools-core
initscripts klibc-utils libalgorithm-diff-xs-perl libapparmor-perl libblkid1
libdbd-mysql-perl libdbi-perl libfdisk1 libfile-fcntllock-perl libgcrypt20
libgpg-error0 libklibc liblocale-gettext-perl libmount1 libmysqlclient20
libncurses5 libncursesw5 libperl5.22 libselinux1 libsmartcols1
libsub-name-perl libsystemd0 libtext-charwidth-perl libtext-iconv-perl
libtinfo5 libudev1 lsb-base perl perl-base perl-modules-5.22 rename
sysvinit-utils udev util-linux
Suggested packages:
rdnssd libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl
rng-tools perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl
bootlogd sash kbd console-tools util-linux-locales
The following packages will be REMOVED:
libterm-readkey-perl libtext-soundex-perl linux-image-3.13.0-79-generic
linux-image-extra-3.13.0-79-generic mysql-client-5.5 perl-modules
The following NEW packages will be installed:
initramfs-tools initramfs-tools-core libfdisk1 libgcrypt20 libmysqlclient20
libperl5.22 libsmartcols1 libsystemd0 perl-modules-5.22 rename udev
The following packages will be upgraded:
bash-completion cloud-guest-utils coreutils dpkg ifupdown
init-system-helpers initramfs-tools-bin initscripts klibc-utils
libalgorithm-diff-xs-perl libapparmor-perl libblkid1 libdbd-mysql-perl
libdbi-perl libfile-fcntllock-perl libgpg-error0 libklibc
liblocale-gettext-perl libmount1 libncurses5 libncursesw5 libselinux1
libsub-name-perl libtext-charwidth-perl libtext-iconv-perl libtinfo5
libudev1 lsb-base perl perl-base sysvinit-utils util-linux
32 upgraded, 11 newly installed, 6 to remove and 277 not upgraded.
4 not fully installed or removed.
Need to get 0 B/16.2 MB of archives.
After this operation, 202 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Extracting templates from packages: 100%
(Reading database ... 143659 files and directories currently installed.)
Removing linux-image-extra-3.13.0-79-generic (3.13.0-79.123) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-79-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
/etc/kernel/postinst.d/initramfs-tools: 33: /etc/kernel/postinst.d/initramfs-tools: update-initramfs: not found
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-79-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-79-generic (3.13.0-79.123) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-79-generic /boot/vmlinuz-3.13.0-79-generic
/etc/kernel/postrm.d/initramfs-tools: 33: /etc/kernel/postrm.d/initramfs-tools: update-initramfs: not found
run-parts: /etc/kernel/postrm.d/initramfs-tools exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-79-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-79-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-79-generic
linux-image-3.13.0-79-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
ls -l /boot
output:
root@web:~# ls -l /boot
total 70752
-rw-r--r-- 1 root root 1165578 Mar 10 2016 abi-3.13.0-83-generic
-rw-r--r-- 1 root root 166221 May 9 2019 config-3.13.0-170-generic
-rw-r--r-- 1 root root 165918 Mar 10 2016 config-3.13.0-83-generic
-rw-r--r-- 1 root root 191071 Nov 13 22:00 config-4.4.0-170-generic
drwxr-xr-x 5 root root 4096 Dec 29 08:09 grub
-rw-r--r-- 1 root root 20352301 Dec 29 08:05 initrd.img-3.13.0-170-generic
-rw-r--r-- 1 root root 20176312 Dec 29 08:05 initrd.img-3.13.0-79-generic
-rw-r--r-- 1 root root 176500 Mar 12 2014 memtest86+.bin
-rw-r--r-- 1 root root 178176 Mar 12 2014 memtest86+.elf
-rw-r--r-- 1 root root 178680 Mar 12 2014 memtest86+_multiboot.bin
-rw------- 1 root root 3418683 May 9 2019 System.map-3.13.0-170-generic
-rw------- 1 root root 3393725 Mar 10 2016 System.map-3.13.0-83-generic
-rw------- 1 root root 3913902 Nov 13 22:00 System.map-4.4.0-170-generic
-rw------- 1 root root 5909496 May 14 2019 vmlinuz-3.13.0-170-generic
-rw------- 1 root root 5827776 Mar 10 2016 vmlinuz-3.13.0-83-generic
-rw------- 1 root root 7208856 Nov 14 10:33 vmlinuz-4.4.0-170-generic
uname -a
output:
root@web:~# uname -a
Linux web 3.13.0-83-generic #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
dpkg -l | grep linux-image
output:
root@web:~# dpkg -l | grep linux-image
ii linux-image-3.13.0-170-generic 3.13.0-170.220 amd64 Signed kernel image generic
rc linux-image-3.13.0-77-generic 3.13.0-77.121 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rH linux-image-3.13.0-79-generic 3.13.0-79.123 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
iU linux-image-3.13.0-83-generic 3.13.0-83.127 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
iF linux-image-4.4.0-170-generic 4.4.0-170.199 amd64 Signed kernel image generic
rc linux-image-extra-3.13.0-77-generic 3.13.0-77.121 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
rH linux-image-extra-3.13.0-79-generic 3.13.0-79.123 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-generic 4.4.0.170.178 amd64 Generic Linux kernel image
dpkg -l | egrep -v '^ii|rc'
output:
root@web:~# dpkg -l | egrep -v '^ii|rc'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=======================================-===============================================-============-===============================================================================
rH linux-image-3.13.0-79-generic 3.13.0-79.123 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rH linux-image-3.13.0-83-generic 3.13.0-83.127 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
iF linux-image-4.4.0-170-generic 4.4.0-170.199 amd64 Signed kernel image generic
rH linux-image-extra-3.13.0-79-generic 3.13.0-79.123 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
dpkg -l | egrep -v '^ii|rc'
please?