0
  • I'm encountering an issue when trying to remove a specific Linux kernel package on my Ubuntu system. The error seems to be related to a post-removal script that updates the GRUB bootloader configuration. Here are the details of the problem:
  • I attempted to remove the package linux-image-6.2.0-35-generic using sudo apt-get remove --purge linux-image-6.2.0-35-generic.
  • But not fix the issue how can I fix this error please help Me.
/etc/grub.d/proxifiedScripts/linux: 1: version_find_latest: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-6.2.0-35-generic (--remove):
 installed linux-image-6.2.0-35-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.2.0-35-generic
Ganesh
  • 11

5 Answers5

3

I recently found solution at some github issue.

Try to replace /etc/grub.d/proxifiedScripts/linux about 400 line (linux=...) to

linux=`echo $list | tr ' ' '\n' | sort -V | head -1 | cat`

keedosn
  • 31
1

Ganesh, my grub was corrupted by the Customizer as well. I couldn't reinstall grub because of that error and nothing I found online worked. I was desperate so I modified the script to skip that part and it installed grub which is working now.

No guarantees... So, what I did was edited the 'linux' script mentioned in the error. Searched for 'version_find_latest' and modified the while loop to skip it. (I changed '!=x' to '=x') Ran my 'apt upgrade' successfully then undid my change.

0

I had this similar error:

/etc/grub.d/10_linux: 1: version_find_latest: not found

And solved it with:

$ sudo mv /etc/grub.d/10_linux /tmp
$ sudo grub-mkconfig

Maybe a similar solution will work for you.

Jonathan
  • 101
0

I had needed to use the original 10_linux which was next to my 10_linux as 10_linux.dpkg-dist.

Thus

cd /etc/grub.d
sudo mv 10_linux <Some backup path>
sudo mv 10_linux.dpkg-dist 10_linux
sudo update-grub

fixed the issue. Make sure that update-grub outputs something like

Found linux image: /boot/vmlinuz-6.5.0-14-generic
Found initrd image: /boot/initrd.img-6.5.0-14-generic

Otherwise you'll need to fix your system booting from a live system.

Morty
  • 111
0

This issue is caused by Grub-Customizer. You can solve it uninstalling grub-customizer and deleting /etc/grub.d/LS_linux . Then you must run sudo update-grub2

bitseater
  • 206