I can't remove old kernel image - Ubuntu 16.04.6 LTSApt errors since upgrade to 12.04Updates fail due to “/etc/default/grub: splash”: not found” error kernel did not upgrade between 12.04->12.10->13.04cannot upgrade kernel and mysql-server after dist upgradeLinux Headers not upgrading. It says “no space” when I have lotsHow can I remove a package?APT is stuck because it can't remove an old kernelErrors every time I use 'apt install' because of old kernels

Why is 1>a.txt 2>&1 different from 1>a.txt 2>a.txt ? (Example shown)

I've never seen this before. Is this primarily a "rote computational trick" for multiplication by 9 ...?

What was the first "Opening Repertoire" book?

Why is Trump not being impeached for bribery?

Why qiskit superconducting device native gates different from that of trapped ion device?

Is there a Scoville scale for coldness?

Number of Matrices having determinant 1

Avoid long walking when changing between Tokyo subway lines

Is it possible to kill parasitic worms by intoxicating oneself?

How to correctly export env variables containing spaces in ZSH

Sorting marbles based on weightings

How do I force `sudo` to ask for a password each time when a specific command is used?

Sudden cheap travel?

Do the Jovians in "Victory Unintentional" exist in Isaac Asimov's Foundation series?

"Sack" data structure in C#

Has any person or company ever become a sovereign state?

Open a Folder in the File Manager by a Python Script

What is a winning position in chess?

Would a uranium 235 fuel pellet the size of Earth explode?

how technically soft landing works without air on moon?

My boss asked what number would keep me happy?

How to prevent discontent among the players when one player murders the others' characters?

Is it possible for nature to create bubble wrap?

Undesired blank space between some words



I can't remove old kernel image - Ubuntu 16.04.6 LTS


Apt errors since upgrade to 12.04Updates fail due to “/etc/default/grub: splash”: not found” error kernel did not upgrade between 12.04->12.10->13.04cannot upgrade kernel and mysql-server after dist upgradeLinux Headers not upgrading. It says “no space” when I have lotsHow can I remove a package?APT is stuck because it can't remove an old kernelErrors every time I use 'apt install' because of old kernels






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1


















My uname -a returns following.



Linux <hidden> 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


When I try to upgrade the packages, it fails by showing following errors regarding an old kernel.



Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic
The following packages have been kept back:
libapache2-mod-php libapache2-mod-php7.0 libgd3 php-gd php-mbstring php-mysql php-xml php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-fpm php7.0-gd
php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-soap php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
0 upgraded, 0 newly installed, 2 to remove and 24 not upgraded.
4 not fully installed or removed.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 142623 files and directories currently installed.)
Removing linux-image-extra-3.13.0-68-generic (3.13.0-68.111) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-68-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-68-generic
WARNING: missing /lib/modules/3.13.0-68-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-68-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: amd64-microcode: unsupported kernel version!
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 10
dpkg: error processing package linux-image-extra-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-68-generic (3.13.0-68.111) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-68-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 10
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-68-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-68-generic
linux-image-3.13.0-68-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)


Edit: Output of apt list --installed | grep grub



WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

grub-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-gfxpayload-lists/xenial,now 0.7 amd64 [installed,automatic]
grub-pc/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-pc-bin/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]
grub2-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]









share|improve this question



























  • See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

    – cmak.fr
    Oct 1 at 8:16











  • You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

    – guiverc
    Oct 1 at 8:25











  • I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

    – Bash
    Oct 1 at 8:39











  • Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

    – Bash
    Oct 1 at 8:40











  • apt list --installed | grep grub edit your question for output please.

    – nobody
    Oct 2 at 9:21

















1


















My uname -a returns following.



Linux <hidden> 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


When I try to upgrade the packages, it fails by showing following errors regarding an old kernel.



Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic
The following packages have been kept back:
libapache2-mod-php libapache2-mod-php7.0 libgd3 php-gd php-mbstring php-mysql php-xml php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-fpm php7.0-gd
php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-soap php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
0 upgraded, 0 newly installed, 2 to remove and 24 not upgraded.
4 not fully installed or removed.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 142623 files and directories currently installed.)
Removing linux-image-extra-3.13.0-68-generic (3.13.0-68.111) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-68-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-68-generic
WARNING: missing /lib/modules/3.13.0-68-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-68-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: amd64-microcode: unsupported kernel version!
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 10
dpkg: error processing package linux-image-extra-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-68-generic (3.13.0-68.111) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-68-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 10
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-68-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-68-generic
linux-image-3.13.0-68-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)


Edit: Output of apt list --installed | grep grub



WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

grub-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-gfxpayload-lists/xenial,now 0.7 amd64 [installed,automatic]
grub-pc/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-pc-bin/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]
grub2-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]









share|improve this question



























  • See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

    – cmak.fr
    Oct 1 at 8:16











  • You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

    – guiverc
    Oct 1 at 8:25











  • I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

    – Bash
    Oct 1 at 8:39











  • Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

    – Bash
    Oct 1 at 8:40











  • apt list --installed | grep grub edit your question for output please.

    – nobody
    Oct 2 at 9:21













1













1









1








My uname -a returns following.



Linux <hidden> 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


When I try to upgrade the packages, it fails by showing following errors regarding an old kernel.



Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic
The following packages have been kept back:
libapache2-mod-php libapache2-mod-php7.0 libgd3 php-gd php-mbstring php-mysql php-xml php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-fpm php7.0-gd
php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-soap php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
0 upgraded, 0 newly installed, 2 to remove and 24 not upgraded.
4 not fully installed or removed.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 142623 files and directories currently installed.)
Removing linux-image-extra-3.13.0-68-generic (3.13.0-68.111) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-68-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-68-generic
WARNING: missing /lib/modules/3.13.0-68-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-68-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: amd64-microcode: unsupported kernel version!
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 10
dpkg: error processing package linux-image-extra-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-68-generic (3.13.0-68.111) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-68-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 10
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-68-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-68-generic
linux-image-3.13.0-68-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)


Edit: Output of apt list --installed | grep grub



WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

grub-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-gfxpayload-lists/xenial,now 0.7 amd64 [installed,automatic]
grub-pc/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-pc-bin/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]
grub2-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]









share|improve this question
















My uname -a returns following.



Linux <hidden> 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


When I try to upgrade the packages, it fails by showing following errors regarding an old kernel.



Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic
The following packages have been kept back:
libapache2-mod-php libapache2-mod-php7.0 libgd3 php-gd php-mbstring php-mysql php-xml php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-fpm php7.0-gd
php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-soap php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-zip
0 upgraded, 0 newly installed, 2 to remove and 24 not upgraded.
4 not fully installed or removed.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 142623 files and directories currently installed.)
Removing linux-image-extra-3.13.0-68-generic (3.13.0-68.111) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-68-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-68-generic
WARNING: missing /lib/modules/3.13.0-68-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-68-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: amd64-microcode: unsupported kernel version!
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_30aiDQ/lib/modules/3.13.0-68-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postinst.d/x-grub-legacy-ec2 exited with return code 10
dpkg: error processing package linux-image-extra-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-68-generic (3.13.0-68.111) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-68-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 3.13.0-68-generic /boot/vmlinuz-3.13.0-68-generic
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/memtest86+.bin
dpkg-query: error: package 'grub-legacy-ec2' is not installed
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 10
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-68-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-68-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-68-generic
linux-image-3.13.0-68-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)


Edit: Output of apt list --installed | grep grub



WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

grub-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-gfxpayload-lists/xenial,now 0.7 amd64 [installed,automatic]
grub-pc/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed]
grub-pc-bin/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]
grub2-common/xenial-updates,now 2.02~beta2-36ubuntu3.22 amd64 [installed,automatic]






boot apt grub2 kernel dpkg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 3 at 10:06







Bash

















asked Oct 1 at 8:11









BashBash

133 bronze badges




133 bronze badges















  • See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

    – cmak.fr
    Oct 1 at 8:16











  • You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

    – guiverc
    Oct 1 at 8:25











  • I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

    – Bash
    Oct 1 at 8:39











  • Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

    – Bash
    Oct 1 at 8:40











  • apt list --installed | grep grub edit your question for output please.

    – nobody
    Oct 2 at 9:21

















  • See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

    – cmak.fr
    Oct 1 at 8:16











  • You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

    – guiverc
    Oct 1 at 8:25











  • I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

    – Bash
    Oct 1 at 8:39











  • Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

    – Bash
    Oct 1 at 8:40











  • apt list --installed | grep grub edit your question for output please.

    – nobody
    Oct 2 at 9:21
















See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

– cmak.fr
Oct 1 at 8:16





See how to resolve error code 1 : itsfoss.com/dpkg-returned-an-error-code-1

– cmak.fr
Oct 1 at 8:16













You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

– guiverc
Oct 1 at 8:25





You have a really old version of grub installed (v1), but an error message reports grub-legacy-ec2 is not installed so installing that may fix your issue (I haven't used old grub in years which is why the hesitation)

– guiverc
Oct 1 at 8:25













I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

– Bash
Oct 1 at 8:39





I've tried to auto remove, but this also fails with the same errors. Regarding the grub, my present version 2. As you can see the running kernel is 4.4.0-116-generic.

– Bash
Oct 1 at 8:39













Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

– Bash
Oct 1 at 8:40





Is there a way to remove them manually, like moving/deleting. I dont' know the location of the folders.

– Bash
Oct 1 at 8:40













apt list --installed | grep grub edit your question for output please.

– nobody
Oct 2 at 9:21





apt list --installed | grep grub edit your question for output please.

– nobody
Oct 2 at 9:21










1 Answer
1






active

oldest

votes


















0



















sudo dpkg -P grub-legacy-ec2


To get rid of possible remains files.



It would be better from me to ask over dpkg.



If errorrs pop up, but only when



sudo mv /etc/kernel/postinst.d/x-grub-legacy-ec2 $HOME


Remove
The same please for



/boot/grub/default


and for



/boot/grub/menu.lst



then dry to remove the old kernel



sudo dpkg -P linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic


Next is important so you do not end up without any bootloader.



sudo apt install --reinstall grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub-pc-bin grub2-common


And now install grub2 bootcode. We don't know which one is present in mbr.



sudo dpkg-reconfigure grub-pc


grub2



and at least



sudo update-grub





share|improve this answer



























  • I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

    – Bash
    Oct 4 at 12:10











  • sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

    – nobody
    Oct 4 at 12:16











  • Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

    – Bash
    Oct 6 at 5:19












  • Oh, I forgot. Looks fine.

    – nobody
    Oct 7 at 16:36












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177848%2fi-cant-remove-old-kernel-image-ubuntu-16-04-6-lts%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0



















sudo dpkg -P grub-legacy-ec2


To get rid of possible remains files.



It would be better from me to ask over dpkg.



If errorrs pop up, but only when



sudo mv /etc/kernel/postinst.d/x-grub-legacy-ec2 $HOME


Remove
The same please for



/boot/grub/default


and for



/boot/grub/menu.lst



then dry to remove the old kernel



sudo dpkg -P linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic


Next is important so you do not end up without any bootloader.



sudo apt install --reinstall grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub-pc-bin grub2-common


And now install grub2 bootcode. We don't know which one is present in mbr.



sudo dpkg-reconfigure grub-pc


grub2



and at least



sudo update-grub





share|improve this answer



























  • I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

    – Bash
    Oct 4 at 12:10











  • sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

    – nobody
    Oct 4 at 12:16











  • Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

    – Bash
    Oct 6 at 5:19












  • Oh, I forgot. Looks fine.

    – nobody
    Oct 7 at 16:36















0



















sudo dpkg -P grub-legacy-ec2


To get rid of possible remains files.



It would be better from me to ask over dpkg.



If errorrs pop up, but only when



sudo mv /etc/kernel/postinst.d/x-grub-legacy-ec2 $HOME


Remove
The same please for



/boot/grub/default


and for



/boot/grub/menu.lst



then dry to remove the old kernel



sudo dpkg -P linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic


Next is important so you do not end up without any bootloader.



sudo apt install --reinstall grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub-pc-bin grub2-common


And now install grub2 bootcode. We don't know which one is present in mbr.



sudo dpkg-reconfigure grub-pc


grub2



and at least



sudo update-grub





share|improve this answer



























  • I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

    – Bash
    Oct 4 at 12:10











  • sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

    – nobody
    Oct 4 at 12:16











  • Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

    – Bash
    Oct 6 at 5:19












  • Oh, I forgot. Looks fine.

    – nobody
    Oct 7 at 16:36













0















0











0









sudo dpkg -P grub-legacy-ec2


To get rid of possible remains files.



It would be better from me to ask over dpkg.



If errorrs pop up, but only when



sudo mv /etc/kernel/postinst.d/x-grub-legacy-ec2 $HOME


Remove
The same please for



/boot/grub/default


and for



/boot/grub/menu.lst



then dry to remove the old kernel



sudo dpkg -P linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic


Next is important so you do not end up without any bootloader.



sudo apt install --reinstall grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub-pc-bin grub2-common


And now install grub2 bootcode. We don't know which one is present in mbr.



sudo dpkg-reconfigure grub-pc


grub2



and at least



sudo update-grub





share|improve this answer
















sudo dpkg -P grub-legacy-ec2


To get rid of possible remains files.



It would be better from me to ask over dpkg.



If errorrs pop up, but only when



sudo mv /etc/kernel/postinst.d/x-grub-legacy-ec2 $HOME


Remove
The same please for



/boot/grub/default


and for



/boot/grub/menu.lst



then dry to remove the old kernel



sudo dpkg -P linux-image-3.13.0-68-generic linux-image-extra-3.13.0-68-generic


Next is important so you do not end up without any bootloader.



sudo apt install --reinstall grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub-pc-bin grub2-common


And now install grub2 bootcode. We don't know which one is present in mbr.



sudo dpkg-reconfigure grub-pc


grub2



and at least



sudo update-grub






share|improve this answer















share|improve this answer




share|improve this answer








edited Oct 26 at 19:50

























answered Oct 3 at 10:52









nobodynobody

1,7961 gold badge5 silver badges18 bronze badges




1,7961 gold badge5 silver badges18 bronze badges















  • I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

    – Bash
    Oct 4 at 12:10











  • sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

    – nobody
    Oct 4 at 12:16











  • Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

    – Bash
    Oct 6 at 5:19












  • Oh, I forgot. Looks fine.

    – nobody
    Oct 7 at 16:36

















  • I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

    – Bash
    Oct 4 at 12:10











  • sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

    – nobody
    Oct 4 at 12:16











  • Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

    – Bash
    Oct 6 at 5:19












  • Oh, I forgot. Looks fine.

    – nobody
    Oct 7 at 16:36
















I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

– Bash
Oct 4 at 12:10





I've removed the dpkg status files' description of the said kernel images and removed the menu.lst file. I haven't restarted the OS yet. Now the errors disappeared. Do you think any booting problem appear?

– Bash
Oct 4 at 12:10













sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

– nobody
Oct 4 at 12:16





sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk 'print $2' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' X | xargs -n1 -IY sh -c "case "Y" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac"" will show if grub2 is correct set in the MBR

– nobody
Oct 4 at 12:16













Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

– Bash
Oct 6 at 5:19






Its output: /dev/vda: GRUB 2 v1.99 /dev/vda1: Kein GRUB 00 /dev/vda14: Kein GRUB 31d2 /dev/vda15: Kein GRUB 6f74 /dev/vdb: Kein GRUB 00

– Bash
Oct 6 at 5:19














Oh, I forgot. Looks fine.

– nobody
Oct 7 at 16:36





Oh, I forgot. Looks fine.

– nobody
Oct 7 at 16:36


















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177848%2fi-cant-remove-old-kernel-image-ubuntu-16-04-6-lts%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?