Upgraded to 18.04 and now have many broken packages and unmet dependencies

Here are a couple of things to try.

Method One:

This is the easiest one to try. Instead of using sudo apt-get install PACKAGENAME, where PACKAGENAME is the package you’re trying to install with the apt system, use sudo apt-get install -f. The -f parameter will attempt to correct a system which has broken dependencies, after which you’ll be able to install the package in question.

Open a Terminal and type in:

sudo apt-get install -f

and press ENTER.

Now type in:

sudo dpkg --configure -a

and press ENTER.

Now one more time:

sudo apt-get install -f

Method Two:

Aptitude is an alternative of apt-get which you can use as a higher-level package manager. You can use it to try and install your package with it, instead of apt-get, but first you need to install aptitude.

Open a Terminal and type in:

sudo apt-get install aptitude

and press ENTER.

Now type in:

sudo aptitude install PACKAGENAME

and press ENTER.

PACKAGENAME is the package you’re installing. This will try to install the package via aptitude instead of apt-get, which should potentially fix the unmet dependencies issue.

IF THOSE DO NOT WORK

The broken package is mot likely locked and needs to be deleted. To delete the locked file, open a Terminal and type in:

sudo rm /var/lib/apt/lists/lock

and press ENTER.

The locked file may also need to be deleted in the cache directory. To do that, open a Terminal and type in:

sudo rm /var/cache/apt/archives/lock

I upgraded from 16.04 and was having a lot of different issues. I found it much easier to do a fresh install. A fresh or clean install is always the route to go in my opinion.

Hope this helps,


I had the exact same problem. I had to go edit /var/lib/dpkg/status and clear out the entire Depends: line from the packages that were complaining.
I'm not sure what other problems that may cause, but it was the only thing that got apt-get install -f working again.


With root privileges, go to var/lib/dpkg/status and delete the contents of status file.

Then sudo dpkg --configure -a and then sudo apt-get install -f

Then install what you want i.e.

sudo apt-get install nvidia-390