0

OS: Ubuntu 20.04.4 LTS

I'm running this command:

sudo apt upgrade

Then it throws this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-unsigned-5.18.0-051800-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 11,3 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'linux-modules-5.13.0-48-generic' mis
sing; assuming package has no files currently installed
(Reading database ... 428444 files and directories currently installed.)
Removing linux-image-unsigned-5.18.0-051800-generic (5.18.0-051800.202205222030)
 ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.18.0-051800-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/tela/theme.txt
/etc/grub.d/41_linux_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-unsigned-5.18.0-051800-generic (--rem
ove):
 installed linux-image-unsigned-5.18.0-051800-generic package post-removal scrip
t subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-unsigned-5.18.0-051800-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

When I try sudo apt --fix-broken install and the output is:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-unsigned-5.18.0-051800-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 11,3 MB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: warning: files list file for package 'linux-modules-5.13.0-48-generic' mis
sing; assuming package has no files currently installed
(Reading database ... 428444 files and directories currently installed.)
Removing linux-image-unsigned-5.18.0-051800-generic (5.18.0-051800.202205222030)
 ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.18.0-051800-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/tela/theme.txt
/etc/grub.d/41_linux_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-unsigned-5.18.0-051800-generic (--rem
ove):
 installed linux-image-unsigned-5.18.0-051800-generic package post-removal scrip
t subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-unsigned-5.18.0-051800-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then I tried these:

sudo apt remove linux-image-unsigned-5.18.0-051800-generic
sudo apt autoremove

These commands throw the same error. Then I thought maybe I can reinstall this package and

sudo apt-get install linux-modules-5.18.0-051800-generic

It throws this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-modules-5.18.0-051800-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-modules-5.18.0-051800-generic' has no installation candidate

Also, sudo apt update's output is:

Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease                  
Hit:3 http://packages.microsoft.com/repos/code stable InRelease                
Hit:4 http://tr.archive.ubuntu.com/ubuntu focal InRelease                      
Hit:5 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu focal InRelease      
Hit:6 https://updates.signal.org/desktop/apt xenial InRelease                  
Hit:7 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease         
Get:8 http://tr.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]     
Hit:9 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu focal InRelease       
Hit:10 http://repo.mysql.com/apt/ubuntu bionic InRelease                       
Hit:11 http://ppa.launchpad.net/costales/yaru-colors-folder-color/ubuntu focal InRelease
Hit:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease          
Ign:13 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 InRelease    
Hit:14 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease          
Hit:15 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release
Get:16 http://tr.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:17 http://ppa.launchpad.net/gerardpuig/ppa/ubuntu focal InRelease      
Hit:18 http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal InRelease
Hit:20 http://ppa.launchpad.net/numix/ppa/ubuntu focal InRelease
Hit:21 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:22 http://ppa.launchpad.net/papirus/papirus/ubuntu focal InRelease
Hit:23 http://ppa.launchpad.net/teejee2008/ppa/ubuntu focal InRelease
Fetched 336 kB in 2s (149 kB/s)                      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

Note: I've installed this kernel by downloading from https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D My original kernel is (uname -r): 5.13.0-35-generic

I've installed this, because old one was blocking the upgrade as well. I tried to apt-mark hold for these packages, but that also didn't work.

I couldn't understand why I can't upgrade my system. If I can remove this new kernel, how can I do that?

  • @Nmath I've added them. – sundowatch Jun 29 '22 at 05:26
  • @guiverc it is, but it's the reason of the problem. Isn't there any way to solve it? – sundowatch Jun 29 '22 at 05:31
  • You haven't provided any OS/release details so I can't currently provide any specific help (5.13 kernel means you're on an old 20.04 system using HWE, or using the soon to be EOL 21.10 system where I'd not waste any time making it work) but on an updated system it'll be easier; but given I don't know what you're using; I cannot help. – guiverc Jun 29 '22 at 05:33
  • @guiverc you're right. I should have added the OS Version. Sorry, I've done it. – sundowatch Jun 29 '22 at 05:38
  • @Nmath I've added the OS version. Other commands like sudo apt remove linux-image-unsigned-5.18.0-051800-generic and sudo apt autoremove throw the same error. Thanks. – sundowatch Jun 29 '22 at 05:42
  • @Nmath you're right. I've updated update, upgrade and --fix-broken outputs. – sundowatch Jun 29 '22 at 05:55
  • 3
    OK with that information I can see several potential problems. First, as mentioned earlier, you're using an unsupported kernel. Using an unsupported kernel can cause problems. However you also have problems with your package manager. I count at least seventeen (17) sources that you added to your system that aren't the default sources. Adding sources can cause problems and package conflicts, especially PPAs. So with 17, you've got a huge surface area for potential problems. I encourage you to disable/remove unneeded ones. See: https://askubuntu.com/q/35629 – Nmath Jun 29 '22 at 06:02
  • 3
    I also see deadsnakes PPA which hints that you might have changed the default python interpreter-which can really mess up your system if you are not using environments. You also are using a xenial source for signal and bionic for mysql. You should never add sources for another version or distro! This will break your system. Also, why do you even have some of these PPAs? Many of the software added by these PPAs is already in repos. As mentioned, above, adding PPAs increases the risk of breaking your system. Always use the software in repos unless absolutely necessary – Nmath Jun 29 '22 at 06:09
  • Remove any folder and file under /etc/grub.d/ with proxy in name. – nobody Jun 29 '22 at 08:09
  • @Nmath please send it as answer. Because you're totally right. – sundowatch Jun 29 '22 at 08:57
  • On the other hand, @nobody's suggestion worked for me. I removed 41_linux_proxy and everything is fine. – sundowatch Jun 30 '22 at 03:20

1 Answers1

0

After bunch of tries, I've solved my problem by deleting 41_linux_proxy with @nobody's suggestion in the comments.

But I totally agree with @Nmath. Because my package manager totally messed up. Reinstalling Ubuntu would be a good solution, but I've solved for now.