Difficulties changing kernel [Solved]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Difficulties changing kernel [Solved]

Post by norm.h »

Prompted by the Meltdown / Spectre issue, and "Kernel 4.8 has been end of life for a while now, so I'd change it now, and then update again on the 9th" from here:
viewtopic.php?f=60&t=260937&start=40#p1410539 I decided to go ahead and I downloaded 4.4.0.104 intending to patch it when available.

I eventually managed to get into GRUB and booted into the 4.4 kernel but whenever I rebooted I had to select it, so I asked if I needed to delete the 4.8 version altogether and was told "Yes", which I did using the tool in Update Manager.
Then when I rebooted it still tried to load the old kernel and told me I had load it first, so I still had to select the 4.4 version from GRUB.

I checked in Update Manager for installed kernels and found that 4.8 was still installed.
Clicked REMOVE and the remove process gave me this error:

Code: Select all

E: linux-image-extra-4.8.0-53-generic: subprocess installed post-removal script returned error exit status 1
E: linux-image-4.8.0-53-generic: subprocess installed post-removal script returned error exit status 1
Checking Synaptic to see if 4.8 had been uninstalled I found 2 entries in Red [Linux kernel image for version 4.8.0 on 64 bit x86 SMP & Linux kernel extra modules for version 4.8.0 on 64 bit x86 SMP ] had not been removed.
Tried to uninstall the two lines and got the same error, and the lines are still there [in RED]

Intending to go back to Square One with the intention of starting over, I reloaded 4.8.0.53 from Synaptic and enabled it in GRUB
Then went to Update Manager to remove 4.4 and ended up with the same 2 errors as detailed above.
Went to Synaptic to check what is and what isn't installed and the two RED lines are still there but this time for 4.4
Synaptic refuses to uninstall them

Code: Select all

E: linux-image-extra-4.4.0-104-generic: subprocess installed post-removal script returned error exit status 1
E: linux-image-4.4.0-104-generic: subprocess installed post-removal script returned error exit status 1
They are prohibiting [with the same error message] an update to Skype advised in Update Manager, and preventing the installation of 4.13
I get error relating to "trying to recover from package failure" - went to Synaptic to fix broken packages [twice] but that didn't help.

I've googled for "subprocess installed post-removal script returned error exit status 1" and found lots of posts, that are very [for me] complicated, and years old anyway so I'm extremely reluctant try any of them.

Have been advised to try this:

Code: Select all

sudo mv /etc/kernel/postrm.d/zz-update-grub /etc/kernel/postrm.d/zz-update-grub.bad
sudo apt-get install -f
sudo mv /etc/kernel/postrm.d/zz-update-grub.bad /etc/kernel/postrm.d/zz-update-grub
and got.

Code: Select all

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcrypto++9v5 libdbus-c++-1-0v5
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED
  linux-image-4.4.0-104-generic linux-image-extra-4.4.0-104-generic
0 to upgrade, 0 to newly install, 2 to remove and 67 not to upgrade.
4 not fully installed or removed.
After this operation, 220 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 202184 files and directories currently installed.)
Removing linux-image-extra-4.4.0-104-generic (4.4.0-104.127) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-104-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Warning: No support for locale: en_GB.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_WiXVKI/lib/modules/4.4.0-104-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_WiXVKI/lib/modules/4.4.0-104-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-104-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-104-generic (4.4.0-104.127) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-104-generic
The link /vmlinuz is a damaged link
Removing symbolic link vmlinuz 
 you may need to re-run your boot loader[grub]
The link /initrd.img is a damaged link
Removing symbolic link initrd.img 
 you may need to re-run your boot loader[grub]
Errors were encountered while processing:
 linux-image-extra-4.4.0-104-generic
E: Sub-process /usr/bin/dpkg returned an error code (1
I am assuming this is because I have reverted to 4.8 and the command is looking for 4.4
Tried to reinstall 4.4 from Update Manager and got these errors:

Code: Select all

E: linux-image-4.8.0-53-generic: subprocess installed post-installation script returned error exit status 2
E: linux-image-4.4.0-104-generic: subprocess installed post-installation script returned error exit status 2
E: linux-image-extra-4.4.0-104-generic: package linux-image-extra-4.4.0-104-generic is not ready for configuration  cannot configure (current status 'half-installed')
E: linux-image-extra-4.8.0-53-generic: dependency problems - leaving unconfigured 
Totally lost now................
Last edited by norm.h on Thu Jan 11, 2018 7:40 am, edited 2 times in total.

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Reinstalled 4.4 from Update Manager, and booted into it via GRUB, then ran

Code: Select all

sudo mv /etc/kernel/postrm.d/zz-update-grub /etc/kernel/postrm.d/zz-update-grub.bad
sudo apt-get install -f
sudo mv /etc/kernel/postrm.d/zz-update-grub.bad /etc/kernel/postrm.d/zz-update-grub
and got

Code: Select all

normh@normh-nspire2 ~ $ sudo mv /etc/kernel/postrm.d/zz-update-grub /etc/kernel/postrm.d/zz-update-grub.bad
[sudo] password for normh: 
normh@normh-nspire2 ~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcrypto++9v5 libdbus-c++-1-0v5
Use 'sudo apt autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 67 not to upgrade.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-4.4.0-104-generic (4.4.0-104.127) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.4.0-104.127 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.4.0-104.127 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Warning: No support for locale: en_GB.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-104-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-104-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.8.0-53.56~16.04.1 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.8.0-53.56~16.04.1 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
Warning: No support for locale: en_GB.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.8.0-53-generic.postinst line 1052.
dpkg: error processing package linux-image-4.8.0-53-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-104-generic:
 linux-image-extra-4.4.0-104-generic depends on linux-image-4.4.0-104-generic; however:
  Package linux-image-4.4.0-104-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-104-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-4.8.0-53-generic:
 linux-image-extra-4.8.0-53-generic depends on linux-image-4.8.0-53-generic; however:
  Package linux-image-4.8.0-53-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.8.0-53-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-104-generic
 linux-image-4.8.0-53-generic
 linux-image-extra-4.4.0-104-generic
 linux-image-extra-4.8.0-53-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
normh@normh-nspire2 ~ $ ^C
normh@normh-nspire2 ~ $ 

User avatar
Flemur
Level 17
Level 17
Posts: 7903
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Difficulties changing kernel

Post by Flemur »

Wow, what a mess!
linux-image-4.8.0-53-generic is not configured yet.
linux-image-4.4.0-104-generic is not configured yet.
I would try this:

Code: Select all

sudo dpkg-reconfigure linux-image-4.4.0-104-generic
sudo dpkg-reconfigure linux-image-4.8.0-53-generic 
(dpkg-reconfigure is one word, not "dpkg -reconfigure")

A guy fixed a very similar problem here:
https://www.khattam.info/solved-subproc ... 08-04.html
with
sudo aptitude update
sudo aptitude -f install

If it does not work, then you may want to try:

sudo dpkg --force all --remove
I don't know what
"sudo dpkg --force all --remove"
does but it looks dangerous - try the dpkg-reconfigure first.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Many thanks - a job for tomorrow.

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Here are the results of the first four commands. I'm not going to try the last one.

Code: Select all

normh@normh-nspire2 ~ $ sudo dpkg-reconfigure linux-image-4.4.0-104-generic
[sudo] password for normh: 
/usr/sbin/dpkg-reconfigure: linux-image-4.4.0-104-generic is broken or not fully installed.
normh@normh-nspire2 ~ $ sudo dpkg-reconfigure linux-image-4.8.0-53-generic
/usr/sbin/dpkg-reconfigure: linux-image-4.8.0-53-generic is broken or not fully installed.
normh@normh-nspire2 ~ $ sudo aptitude update
Hit http://archive.canonical.com/ubuntu xenial InRelease
Ign http://dl.google.com/linux/chrome/deb stable InRelease                                                                                             
Hit http://archive.ubuntu.com/ubuntu xenial InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit http://dl.google.com/linux/chrome/deb stable Release
Hit http://security.ubuntu.com/ubuntu xenial-security InRelease        
Ign http://packages.linuxmint.com sonya InRelease
Hit http://packages.linuxmint.com sonya Release
Hit https://repo.skype.com/deb stable InRelease
Hit https://dl.ring.cx/ring-nightly/ubuntu_16.04 ring InRelease
                            
normh@normh-nspire2 ~ $ sudo aptitude -f install
The following packages will be REMOVED:  
  libcrypto++9v5{u} libdbus-c++-1-0v5{u} linux-image-4.8.0-53-generic linux-image-extra-4.8.0-53-generic 
The following partially installed packages will be configured:
  linux-image-4.4.0-104-generic linux-image-extra-4.4.0-104-generic 
0 packages upgraded, 0 newly installed, 4 to remove and 67 not upgraded.
Need to get 0 B of archives. After unpacking 239 MB will be freed.
Do you want to continue? [Y/n/?] y
(Reading database ... 228701 files and directories currently installed.)
Removing linux-image-extra-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-53-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
WARNING: missing /lib/modules/4.8.0-53-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.8.0-53-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Warning: No support for locale: en_GB.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_Ji4U3q/lib/modules/4.8.0-53-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Ji4U3q/lib/modules/4.8.0-53-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.8.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
update-initramfs: Deleting /boot/initrd.img-4.8.0-53-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.8.0-53-generic.postrm line 328.
dpkg: error processing package linux-image-4.8.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing libcrypto++9v5 (5.6.1-9) ...
Removing libdbus-c++-1-0v5:amd64 (0.9.0-8ubuntu2) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
 linux-image-extra-4.8.0-53-generic
 linux-image-4.8.0-53-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package.  Trying to recover:
Setting up linux-image-4.4.0-104-generic (4.4.0-104.127) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.4.0-104.127 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.4.0-104.127 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Warning: No support for locale: en_GB.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-104-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-104-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-104-generic:
 linux-image-extra-4.4.0-104-generic depends on linux-image-4.4.0-104-generic; however:
  Package linux-image-4.4.0-104-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-104-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.4.0-104-generic
 linux-image-extra-4.4.0-104-generic                                   
I think something is broken beyond repair - maybe best to do a complete reinstall hmmm.?

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

Code: Select all

sudo rm /var/lib/dpkg/info/linux-image-4.8.0-53-generic.postrm

Code: Select all

sudo rm /var/lib/dpkg/info/linux-image-4.4.0-104-generic.postinst
and then post the output of

Code: Select all

sudo apt-get install -f

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Code: Select all

normh@normh-nspire2 ~ $ sudo rm /var/lib/dpkg/info/linux-image-4.8.0-53-generic.postrm
[sudo] password for normh: 
normh@normh-nspire2 ~ $ sudo rm /var/lib/dpkg/info/linux-image-4.4.0-104-generic.postinst
normh@normh-nspire2 ~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-4.8.0-53-generic linux-image-extra-4.8.0-53-generic
0 to upgrade, 0 to newly install, 2 to remove and 67 not to upgrade.
4 not fully installed or removed.
After this operation, 234 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 228685 files and directories currently installed.)
Removing linux-image-extra-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-53-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
WARNING: missing /lib/modules/4.8.0-53-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.8.0-53-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Warning: No support for locale: en_GB.utf8
depmod: WARNING: could not open /var/tmp/mkinitramfs_mgMM5H/lib/modules/4.8.0-53-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_mgMM5H/lib/modules/4.8.0-53-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-53-generic /boot/vmlinuz-4.8.0-53-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.8.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
Errors were encountered while processing:
 linux-image-extra-4.8.0-53-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
normh@normh-nspire2 ~ $ 

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

Code: Select all

sudo rm /var/lib/dpkg/info/linux-image-extra-4.8.0-53-generic.postrm

Code: Select all

sudo apt-get install -f

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Code: Select all

normh@normh-nspire2 ~ $ sudo rm /var/lib/dpkg/info/linux-image-extra-4.8.0-53-generic.postrm
[sudo] password for normh: 
normh@normh-nspire2 ~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.8.0-53-generic
0 to upgrade, 0 to newly install, 1 to remove and 67 not to upgrade.
3 not fully installed or removed.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 228685 files and directories currently installed.)
Removing linux-image-extra-4.8.0-53-generic (4.8.0-53.56~16.04.1) ...
Setting up linux-image-4.4.0-104-generic (4.4.0-104.127) ...
Setting up linux-image-extra-4.4.0-104-generic (4.4.0-104.127) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-104-generic
Warning: No support for locale: en_GB.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-104-generic /boot/vmlinuz-4.4.0-104-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-104-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-104-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
normh@normh-nspire2 ~ $ 

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

Code: Select all

sudo rm /var/lib/dpkg/info/linux-image-extra-4.4.0-104-generic.postinst

Code: Select all

sudo apt-get install -f

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Thank you for your interest and help.....

Code: Select all

normh@normh-nspire2 ~ $ sudo rm /var/lib/dpkg/info/linux-image-extra-4.4.0-104-generic.postinst
[sudo] password for normh: 
normh@normh-nspire2 ~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 67 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-extra-4.4.0-104-generic (4.4.0-104.127) ...
normh@normh-nspire2 ~ $ 

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

For me now, it's all ok, kernel 4.8.0-53 is removed properly and kernel 4.4.0-104 installed properly

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

OK, thanks again.
I rebooted, but GRUB is still trying to open in 4.8 and I have to select 4.4 from the menu.
The kernel section in Update Manager is only showing 4.4 installed.
How can I boot into 4.4 without having to use GRUB, please?

At least I was able to do an update from Update Manager

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

if you use the 4.4 kernel, boot from 4.4 and from mintupdate/view/kernel linux remove all the versions of 4.8 kernel

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

View > Linux kernels in Update Manager shows no 4.8 kernels installed,
Nor is there anything for 4.8 in Synaptic.

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

boot the system and try an update of grub

Code: Select all

sudo update-grub
and then post also

Code: Select all

dpkg --get-selections | grep linux-image;dpkg --get-selections | grep linux-headers

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Is this the expected response?

Code: Select all

normh@normh-nspire2 ~ $ sudo update-grub
[sudo] password for normh: 
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
normh@normh-nspire2 ~ $

Code: Select all

normh@normh-nspire2 ~ $ dpkg --get-selections | grep linux-image;dpkg --get-selections | grep linux-headers
linux-image-4.13.0-26-generic			install
linux-image-4.4.0-104-generic			install
linux-image-extra-4.13.0-26-generic		install
linux-image-extra-4.4.0-104-generic		install
linux-headers-4.13.0-26				install
linux-headers-4.13.0-26-generic			install
linux-headers-4.4.0-104				install
linux-headers-4.4.0-104-generic			install
normh@normh-nspire2 ~ $ 

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

More puzzlement.........

Code: Select all

normh@normh-nspire2 ~ $ uname -r
4.4.0-104-generic
normh@normh-nspire2 ~ $ 
Tried to download / install an update from Update Manager.
Got similar errors as before, but referring to 4.13
Screenshot at 2018-01-10 15-55-50.png

minitux
Level 5
Level 5
Posts: 854
Joined: Tue Sep 12, 2017 10:05 am

Re: Difficulties changing kernel

Post by minitux »

norm.h wrote:Is this the expected response?
No
try to post this

Code: Select all

cat /etc/default/grub
post also

Code: Select all

sudo apt install -f

norm.h
Level 5
Level 5
Posts: 585
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: Difficulties changing kernel

Post by norm.h »

Code: Select all

normh@normh-nspire2 ~ $ cat /etc/default/grub
 If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
normh@normh-nspire2 ~ $ sudo apt install -f
[sudo] password for normh: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 66 not to upgrade.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-pc (2.02~beta2-36ubuntu3.9+linuxmint1) ...
/var/lib/dpkg/info/grub-pc.config: 1: /etc/default/grub: If: not found
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up linux-image-4.13.0-26-generic (4.13.0-26.29~16.04.2) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-4.13.0-26-generic
) points to /boot/initrd.img-4.13.0-26-generic
 (/boot/initrd.img-4.13.0-26-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.13.0-26-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-4.13.0-26-generic
) points to /boot/vmlinuz-4.13.0-26-generic
 (/boot/vmlinuz-4.13.0-26-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.13.0-26-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-26-generic /boot/vmlinuz-4.13.0-26-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-26-generic /boot/vmlinuz-4.13.0-26-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-26-generic /boot/vmlinuz-4.13.0-26-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-26-generic
Warning: No support for locale: en_GB.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.13.0-26-generic /boot/vmlinuz-4.13.0-26-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.13.0-26-generic /boot/vmlinuz-4.13.0-26-generic
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.13.0-26-generic.postinst line 1052.
dpkg: error processing package linux-image-4.13.0-26-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-4.13.0-26-generic:
 linux-image-extra-4.13.0-26-generic depends on linux-image-4.13.0-26-generic; however:
  Package linux-image-4.13.0-26-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.13.0-26-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-pc
 linux-image-4.13.0-26-generic
 linux-image-extra-4.13.0-26-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
normh@normh-nspire2 ~ $ 

Post Reply

Return to “Installation & Boot”