Score:1

Unmet dependencies. Try 'apt --fix-broken install'- Conflict in linux-image

cn flag

I can't install packages with apt. I am using Ubuntu 20.04 Focal.

Some packages require linux-image-5.11.0-38-generic, as seen below.

:~$ sudo apt install <package>

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-image-generic-hwe-20.04 : Depends: linux-image-5.11.0-38-generic but it is not going to be installed
 linux-modules-5.11.0-38-generic : Depends: linux-image-5.11.0-38-generic but it is not going to be installed or
                                            linux-image-unsigned-5.11.0-38-generic but it is not going to be installed
 linux-modules-extra-5.11.0-38-generic : Depends: linux-image-5.11.0-38-generic but it is not going to be installed or
                                                  linux-image-unsigned-5.11.0-38-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

My kernel:

$ uname -r
5.11.0-37-generic

Can I install 5.11.0-38 somehow? Or downgrade these packages so that they will be compatible with 5.11.0-37?

Nmath avatar
ng flag
You have at least "53 packages not upgraded" which suggests that you have deferred maintenance. Can you run `sudo apt update` and `sudo apt upgrade`? These commands should always be run before installing any new software.
Ermolai avatar
cn flag
@Nmath Already tried these. I can update normally,but when i try to upgrade the errors from 1. show up (see my question for "1." - E: Unmet dependencies. Try 'apt --fix-broken install') Thanks for your time
Nmath avatar
ng flag
When was the last time you were able to successfully complete this system maintenance and what changes have been made to the system since then?
Someone avatar
my flag
See the edited part of my questions
es flag
Do you happen to run Sophos antivirus or some other antivirus service in the system?
Ermolai avatar
cn flag
@jarno My company runs mcaffe antivirus on all laptops
es flag
https://kc.mcafee.com/corporate/index?page=content&id=KB87210&locale=en_US
Ermolai avatar
cn flag
Edited the question.I hope it is more helpful now. I realized me kernel is linux-image-5.11.0-37-generic and the 5.11.0-38 is not installed
es flag
I think your antivirus software may prevent installing a new kernel. Maybe the link I gave above helps.
Ermolai avatar
cn flag
jarno You were correct. I disabled mcaffe and run 'sudo apt --fix-broken install' and the problem was solved. Big thanks to @Algnis for helping me
Someone avatar
my flag
@Ermolai I am happy to help
Score:4
in flag

From this tutorial:

Method 1: Reconfigure Package Database

The first method you can try is to reconfigure the package database. Probably the database got corrupted while installing a package. Reconfiguring often fixes the problem.

sudo dpkg --configure -a

Method 2: Use force install

If a package installation was interrupted previously, you may try to do a force install.

sudo apt-get install -f

Method 3: Try removing the troublesome package

If it’s not an issue for you, you may try to remove the package manually. Please don’t do it for Linux Kernels (packages starting with linux-).

sudo apt remove package_name

Method 4: Remove post info files of the troublesome package

This should be your last resort. You can try removing the files associated to the package in question from /var/lib/dpkg/info.

Score:1
tf flag

So I found the answer in my case was a bad /etc/default/grub file. I found an extra pair of quotes on my GRUB_CMDLINE_LINUX_DEFAULT= that i had edited a while back.

I fixed the grub file and ran update-grub rebooted, then did an apt --fix-broken install. This fixed my updates and now I'm on 5.11.0-41-generic with no issues.

Score:1
bo flag

Sometimes this happens when a kernel is released and all the dependencies aren't released or available yet. On packages.ubuntu.com the unmet dependencies for linux-image-5.11.0-38-generic (or whatever the specific kernel version is) will show up as suggested packages and will say "not available".

If you try to do apt-cache show <packagename> for one of the dependencies that are listed as "not available" yet, it will complain that the package is strictly a virtual package or must be provided by some other package. This of course, is not entirely true as the package is simply not available yet but apt assumes otherwise.

So you have at least two possible options.

  1. You can probably force the install using sudo apt install --no-install-recommends linux-image-5.11.0-38-generic. But this will leave you without the modules, tools, and header packages which may cause issues.

  2. Simply wait a few hours or maybe a full day and the problem will go away on its own when the dependencies are released. A simple sudo apt update and sudo apt full-upgrade will install all available packages.


I recently had the same problem with a subsequent hwe kernel update on 20.04. Apt said there were 4 updates available but when I ran sudo apt dist-upgrade or full-upgrade it would say 0 packages installed.

Checking the output of apt list --upgradable revealed hwe kernel updates but manually installing linux-image-generic-hwe-20.04 and the other packages gave the same errors shown in the question but different versions, of course.

Score:0
my flag

I found the solution (specific for your issue)

 sudo rm -rf /var/cache/apt/archives/linux*

This command removes every file which was causing errors

If this didn't worked

Then

sudo rm -rf /var/lib/dpkg/info/linux-modules-5.11.0-38-generic 
sudo rm -rf /var/lib/dpkg/info/linux-image-generic-hwe-20.04
sudo rm -rf /var/lib/dpkg/info/linux-modules-extra-5.11.0-38-generic
sudo rm -rf /var/lib/dpkg/info/linux-generic-hwe-20.04
sudo apt install linux-modules-5.11.0-38-generic linux-image-generic-hwe-20.04  linux-modules-extra-5.11.0-38-generic linux-generic-hwe-20.04
sudo dpkg --configure -a 

Also you should disable your antivirus and then run 'sudo apt --fix-broken install`.

Ermolai avatar
cn flag
Didn't work :( Thanks for your time :)
Someone avatar
my flag
@Ermolai see the edited thing
Ermolai avatar
cn flag
I removed the files you specified. When i tried to run "apt install... " https://i.imgur.com/oX4EYMG.png
Someone avatar
my flag
Can you run other commands like `sudo apt upgrade` @Ermolai
Ermolai avatar
cn flag
No the same error keeps poping-up. https://i.imgur.com/2n1Ghky.png Is the only solution to just re-install ubuntu?
Ermolai avatar
cn flag
'sudo dpkg --configure -a' https://i.imgur.com/Nwzsijn.png
Someone avatar
my flag
@Ermolai is aptitude installed ? `sudo aptitude -f install`
Ermolai avatar
cn flag
No it is not https://i.imgur.com/TUXvaHm.png
Ermolai avatar
cn flag
Also: ``` `sudo dpkg --remove linux-image-5.11.0-38-generic` `\n ` `dpkg: warning: ignoring request to remove linux-image-5.11.0-38-generic which isn't installed`
Ermolai avatar
cn flag
Also edited the question.I hope it is more helpful now. I realized me kernel is `linux-image-5.11.0-37-generic` and the 5.11.0-38 is not installed
Someone avatar
my flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/131276/discussion-between-algnis-and-ermolai).
Zanna avatar
kr flag
I thought this was something to do with McAfee? Can you edit your answer to contain what actually worked, if so?
Will avatar
id flag
The comments suggest it didn’t work but the answer is accepted & upvoted - did it work in the end?
Someone avatar
my flag
@Will It is a long story , You need to see [This chat](https://chat.stackexchange.com/rooms/131276/discussion-between-algnis-and-ermolai) to know what happened
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.