4

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
2
  • 1
    Can you show dpkg -l | egrep -v '^ii|rc' please?
    – nobody
    Jan 2, 2020 at 10:21
  • @nobody I've added the output to the bottom of my question.
    – Pankucins
    Jan 2, 2020 at 14:20

2 Answers 2

1
+50

It is not so bad as I expected. okay, lets try to repair that.

First of all make a backup from your important data, really.

Make sure you have enough space and inodes free.

df -h;df -i

Next step is to reinstall initramfs-tools. The command update-initramfs is not found, and is necessary.

sudo apt install --reinstall initramfs-tools=0.122ubuntu8.16

This is the xenial version according to package search, it lies in xenial-updates.

If it is not possible. Draw with wget the package directly

wget -c http://mirrors.kernel.org/ubuntu/pool/main/i/initramfs-tools/initramfs-tools_0.122ubuntu8.16_all.deb

and install it with dpkg.

 sudo dpkg -i initramfs-tools_0.122ubuntu8.16_all.deb

Only, when this is running without error.

sudo dpkg --configure -a && sudo apt-get -f install

Check with

dpkg -l | egrep -v '^ii|rc'

if all packages are in clean state. should be like mine.

Desired=Unknown/Install/Remove/Purge/Hold                                                                                                                    
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend                                                                               
+++-=============================================-========================================-============-===============================================================================                                                                                                                                   

then you can make your upgrade ready.

sudo apt-get update && sudo apt-get dist-upgrade

If something goes wired, let us know.

2
  • I'm not sure why this answer got a downvote, but it was the answer that actually helped me get the server back to a somewhat usable state to actually do the upgrades. Thanks!
    – Pankucins
    Jan 5, 2020 at 12:50
  • Fine. I am glad that it works.
    – nobody
    Jan 5, 2020 at 13:10
1

Ubuntu 14.04 transitioned to Extended Support Maintenance in May 2019. Kernel version updates are normally handled by a single metapackage rather than the specific versions being directly installed manually. You should follow the end of life upgrade instructions from the Ubuntu community help wiki which describe how to upgrade an installed version that is now unsupported.

3
  • Thanks for the answer, however this has not really solved the issues I was having since apt-get still throws the same errors I've posted above.
    – Pankucins
    Jan 2, 2020 at 8:55
  • 1
    @Pankucins Any other answer is pretty much off-topic for AskUbuntu. You are using an End Of Life release. If you want to stay on 14.04 you need to contact Canonical and pay for support. Jan 2, 2020 at 12:07
  • I might've not explained myself correctly - I am trying to upgrade the version to a current release, however I'm unable to do that since I'm having the issues I've described above.
    – Pankucins
    Jan 2, 2020 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .