Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

Fix-Broken Install message in Linux

In Linux I am getting this message:

Package 'linux-modules-extra-5.3.0-28-generic' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-image-generic-hwe-18.04 : Depends: linux-modules-extra-5.3.0-28-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

How can I correct this?
Avatar of Scott Silva
Scott Silva
Flag of United States of America image

I usually see this when you mix repositories that aren't compatible with each other or when trying to manually install a package without all the dependencies...
What distro is it?
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
First just execute the command provided in the error message...

apt --fix-broken install

Open in new window


And as Scott mentions, likely you have mixed repositories (2x+ different Distro repositories setup). If you do have mixed repositories, no command will help. You'll have to fix this problem before taking any other action... or all other actions will likely fail in odd ways.

What seems to have happened... Just a guess, as there's no system data...

1) You were running Ubuntu Bionic (18.04) to start.

2) Then someone has enabled a Ubuntu Focal Fossa (20.04) repository, which is where all 5.X Kernels will live.

3) Then some sort of update or specific install was attempted with the 5.X Kernel, specifically the 5.3.0-28-generic Kernel version.

Note: You must be very careful at this point. If your machine attempts a reboot before this problem is fixed, there's a chance your machine will brick (become unbootable), so let's go through the fixes.

First step will be for you to provide the following data.

dpkg -l | egrep "linux.*generic"

find /etc/apt -type f -exec egrep -il Focal {} \;

Open in new window


This returned data will likely provide next steps.
Here's a guess at your next steps (guessing without data).

1) Manually remove all 5.0.3 Kernel packages.

2) After #1 is complete, be very careful to make sure you have a bootable 4.15 Kernel (Bionic Kernel version) correctly installed. You'll do this by checking your dpkg output which should look similar to this...

net15 # dpkg -l | egrep "linux.*generic" | awk '{ print $2 }'
net15 # dpkg -l | egrep "linux.*generic" | awk '{ print $2 }' | grep 76
linux-image-4.15.0-76-generic
linux-modules-4.15.0-76-generic
linux-modules-extra-4.15.0-76-generic

Open in new window


If you don't have at least 1x full Kernel installed, you must manually install at least 1x working Kernel.

I suggest 4.15.0-76 as this is the latest stable Bionic Kernel.

3) Refer to the find output from the above command. If you find any APT repository files containing Focal, remove them all, then do the following...

apt-get update

Open in new window


To remove all Focal cruft from the APT/DPKG caches.

4) Now the important step, run this command...

update-grub2

Open in new window


This command must run cleanly, before you attempt a reboot, to ensure reboots work.
Avatar of Tek Info
Tek Info

ASKER

I reinstalled the system perhaps this would have worked.