develop with

How to resolve dependencies in apt-get

Resolve all dependencies when installing a package with apt-get.

Ubuntu Linux’s defacto standard install utility is apt-get. It allows you to install packages, add sources for where to get packages, etc… Every once in awhile when you run apt-get install on a package it will tell you the dependencies you don’t have installed. So, in order to resolve all these dependences you need to leverage build-dep.

Example usage:

sudo apt-get build-dep <package name>

If that fails, make sure the source list is up to date.

Also, try updating the linux headers by doing:

sudo apt clean linux-headers-generic-hwe-16.04 linux-signed-generic-hwe-16.04 &&
sudo apt install --reinstall linux-headers-generic-hwe-16.04 linux-signed-generic-hwe-16.04

When all else fails try reinstalling dependencies and package:

sudo apt-cache depends <package> | grep '[ |]Depends: [^<]' | cut -d: -f2 | tr -d ' ' | xargs sudo apt-get --reinstall install -y

For example, reinstalling everything for kubuntu-desktop:

sudo apt-cache depends kubuntu-desktop | grep '[ |]Depends: [^<]' | cut -d: -f2 | tr -d ' ' | xargs sudo apt-get --reinstall install -y

Other references to follow up with: * (https://ubuntuforums.org/showthread.php?t=2378979) * (https://askubuntu.com/questions/275719/reinstall-package-and-its-installed-dependencies)

comments powered by Disqus

Want to see a topic covered? create a suggestion

Get more developer references and books in the developwith store.