Ubuntu 16.04.3 x64安装软件包依赖缺失,如何获取所需依赖?
Hey there! Let's work through those missing dependency headaches on Ubuntu 16.04.3 x64—this is such a common issue, so you’re not alone. Here are the most reliable ways to track down those elusive packages:
Most standard dependencies live right in Ubuntu’s official repos. First, make sure your package index is up to date, then search for the missing package:
- Refresh your package cache to get the latest listings:
sudo apt update - Search for the dependency by name (replace
<dependency-name>with the actual package):apt-cache search <dependency-name> - If the search finds it, install it directly:
sudo apt install <dependency-name>
If the dependency isn’t in the official repos, a community-maintained PPA might have it. PPAs are great for packages that aren’t included by default, but only add PPAs from trusted sources to avoid security risks:
- Add the PPA (replace
<ppa-owner/ppa-name>with the correct PPA string):sudo add-apt-repository ppa:<ppa-owner/ppa-name> - Refresh the package index again:
sudo apt update - Now try installing the dependency:
sudo apt install <dependency-name>
If official repos and PPAs come up empty, you can grab the .deb package directly (make sure it’s built for Ubuntu 16.04 x64—Ubuntu 16.04’s code name is xenial):
- Once you’ve downloaded the correct
.debfile, install it with:sudo dpkg -i /path/to/your/package.deb - If you hit more dependency errors during installation, fix them automatically with:
sudo apt-get -f install
Sometimes dependencies are missing because you’ve disabled key repositories like universe or multiverse. Open your /etc/apt/sources.list file and make sure these lines are present (uncommented):
deb http://archive.ubuntu.com/ubuntu xenial main universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main universe multiverse
After updating the file, runsudo apt updateto refresh the index.
If you’re installing a specific third-party app, it might have its own dedicated Ubuntu repository. The app’s official documentation will usually include instructions to add this repo, which should include all required dependencies for you to install in one go.
内容的提问来源于stack exchange,提问作者user25165




