0

I have a big issue with one of the servers. I need to install firefox for selenium2. When i type:

apt-get install firefox

I got output:

Do you want to continue? [Y/n]
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 libjbig0 amd64 2.1-3.1 [26.6 kB]
Get:2 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 libvpx3 amd64 1.5.0-2ubuntu1 [732 kB]
Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxpm4 amd64 1:3.5.11-1ubuntu0.16.04.1 [33.8 kB]
Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgd3 amd64 2.1.1-4ubuntu0.16.04.8 [126 kB]
Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main amd64 firefox amd64 59.0.2+build1-0ubuntu0.16.04.1 [44.6 MB]
Fetched 45.5 MB in 36s (1,262 kB/s)
Extracting templates from packages: 100%
(Reading database ... 141165 files and directories currently installed.)
Removing linux-image-4.4.0-62-generic (4.4.0-62.83) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
Cannot determine root device.  Assuming /dev/hda1
This error is probably caused by an invalid /etc/fstab
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
/usr/sbin/update-grub-legacy-ec2: line 375: awk: command not found
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-62-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-62-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.4.0-62-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

So, if I think correctly i need to install awk. So i type:

apt-get install original-awk

But that results in a similar error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.4.0-62-generic
The following NEW packages will be installed:
  original-awk
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
28 not fully installed or removed.
Need to get 69.0 kB of archives.
After this operation, 64.6 MB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/universe amd64 original-awk amd64 2012-12-20-5 [69.0 kB]
Fetched 69.0 kB in 1s (59.6 kB/s)
(Reading database ... 141165 files and directories currently installed.)
Removing linux-image-4.4.0-62-generic (4.4.0-62.83) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
Cannot determine root device.  Assuming /dev/hda1
This error is probably caused by an invalid /etc/fstab
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
/usr/sbin/update-grub-legacy-ec2: line 375: awk: command not found
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-62-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-62-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.4.0-62-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also apt-get upgrade give that same error. What i can do? uname -a return:

Linux vps395796 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux.

EDIT: It's doesn't work. Install with --fix-broken flag give that same errors as before:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.4.0-62-generic
The following NEW packages will be installed:
  original-awk
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
28 not fully installed or removed.
Need to get 0 B/69.0 kB of archives.
After this operation, 64.6 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 141165 files and directories currently installed.)
Removing linux-image-4.4.0-62-generic (4.4.0-62.83) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
Cannot determine root device.  Assuming /dev/hda1
This error is probably caused by an invalid /etc/fstab
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
/usr/sbin/update-grub-legacy-ec2: line 375: awk: command not found
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-62-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-62-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.4.0-62-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg --remove linux-image-4.4.0-62-generic retrun errors too:

(Reading database ... 141165 files and directories currently installed.)
Removing linux-image-4.4.0-62-generic (4.4.0-62.83) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Searching for GRUB installation directory ... found: /boot/grub
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
Cannot determine root device.  Assuming /dev/hda1
This error is probably caused by an invalid /etc/fstab
/usr/sbin/update-grub-legacy-ec2: line 85: awk: command not found
/usr/sbin/update-grub-legacy-ec2: line 375: awk: command not found
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-62-generic.postrm line 328.
dpkg: error processing package linux-image-4.4.0-62-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.4.0-62-generic
0

The problem is that APT is first trying to complete the pending transactions in your system. In your case, that means removing an old kernel that is no longer in use. But that step is breaking because "awk" is missing...

You can try this to fix your system:

$ sudo apt-get install --fix-broken original-awk

If that still fails, then try to remove the package manually:

$ sudo dpkg --remove linux-image-4.4.0-62-generic

Hopefully one of these will fix your system and allow you to proceed with package installations.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.