How to Install Missing Dependencies in Ubuntu? [4 Methods]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Dependencies specify some prerequisite packages that need to be installed on the system for a particular package to work as intended. When you’re trying to install a software package that relies on some dependencies and those are not present on your system, it is called missing dependencies. In this tutorial, I’ll demonstrate different ways that you can use to install packages and their missing dependencies in Ubuntu distributions.

Key Takeaways

  • Installing the DEB package in Ubuntu.
  • Inspecting missing dependency issues regarding TeamViewer installation.
  • Resolving missing dependencies that occurred during the installation.

Requirements

Process Flow Chart

[Distro Used Throughout the Tutorial: Ubuntu 22.04.1 LTS]4 methods to install missing dependencies in ubuntu

Free Downloads

Why Missing Dependency Occurs?

Dependencies are necessary for the software to function properly and provide the intended features. Generally, missing dependencies occur when a software package you’re trying to install relies on other software components not present on your system. There are several reasons why missing dependencies can occur:

  • Software Requirements: Many software packages require specific libraries, tools, or runtime environments to function. If these prerequisites are not installed on your system, the software won’t work
  • Version Compatibility: Software packages often require specific versions of dependencies. The software might not work as expected if you have a different version installed or missing altogether.
  • Package Managers: Sometimes, missing dependencies can occur if a package’s metadata is outdated or incorrect, the package manager might not identify and install the required dependencies properly.
  • Incomplete Installation: If an installation process is interrupted or if not all packages are successfully installed, missing dependencies can result.
  • Unaware Removing: If you have removed packages that are normally present, this can lead to missing dependencies.
  • Third-Party Software: Installing software from sources other than official repositories can lead to missing dependencies if those sources do not provide all the required components.

4 Methods to Install Missing Dependencies in Ubuntu

In this guide, I’ll try to install TeamViewer and inspect missing dependencies. After that, I’ll show you different approaches that you can use to install those missing dependencies in your Ubuntu system. To inspect missing dependencies, download and extract the .deb file of TeamViewer from the Free Download section in this article. Then follow these steps:

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Run the below command to list the files in Downloads/ directory:

cd ~/Downloads/
ls
EXPLANATION
  • cd: Command to Change Directory.
  • ls: Lists all the files and folders in the mentioned directory.
  • ~/Downloads/: Absolute path of Downloads folder.
List files in downloads folder.The presence of the .deb file of TeamViewer and libminizip1 dependency package in the Downloads folder ensures the successful downloading of the file.

➌ Now, try installing the .deb file by the following command:

sudo dpkg -i teamviewer_15.43.7_amd64.deb
EXPLANATION
  • sudo: Enables administrative permission.
  • dpkg: Calls DPKG package manager.
  • -i: Option for installing a file with dpkg.
  • teamviewer_15.43.7_amd64.deb: Full name of the .deb file of TeamViewer.
Missing dependency arises while installing teamviewerThe output shows that installing teamviewer_15.43.7_amd64.deb was unsuccessful because it depends on libminizip1 which is missing.

However, you may face more than one dependency missing while installing other software. In this tutorial, I’ll show you four different ways to install those missing dependencies that you can use in your Ubuntu system.

You can read our Comparative Analysis of Methods to distinguish between these four methods and pick the best one for your needs.

Method 1: Using “apt” and “apt-get” to Install Missing Dependencies

APT (Advanced Package Tool) is a powerful package management system used in Debian-based Linux distributions, including Ubuntu. It simplifies software installation by handling dependencies automatically. When the installation is stuck due to missing dependencies, follow these steps to install them with APT.

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Run the following command:

sudo apt install -f
EXPLANATION
  • sudo: Enables administrative permissions.
  • apt: Calls APT package management tools.
  • install: Command for installing package using apt.
  • -f: Flag that indicates to fix the missing dependencies.

➌ Type Y when the confirmation prompt appears.

➍ Press ENTER.apt installs missing dependencies.The above command detects all missing dependencies and installs them automatically.

Additionally, you can use apt-get which is a command-line tool commonly used tools for package management in Ubuntu. The command to install missing dependencies using apt-get command is:

sudo apt-get install -y –fix-broken

This command also serves the same as APT.

Method 2: Using GDebi to Install Missing Dependencies

GDebi is mainly a GUI (Graphical User Interface) tool but it also supports CLI (Command Line Interface) to use for installing Debian (.deb) packages on Debian-based Linux distributions, including Ubuntu. It provides a user-friendly interface and handles dependencies automatically. To install missing dependencies using it, follow the below steps:

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Run the following command:

sudo gdebi ~/Downloads/libminizip1_1.1-8build1_amd64.deb
EXPLANATION
  • sudo: Grants administrative permissions.
  • gdebi: Calls GDebi package management
  • ~/Downloads/teamviewer_15.43.7_amd64.deb: Full name of the package with absolute path.

➌ Type Y when the confirmation prompt appears.

➍ Press ENTER.GDebi installs missing dependenciesThe above command automatically detects and installs the missing dependencies.

Method 3: Using DPKG to Install Missing Dependencies

DPKG (Debian Package Manager) is a low-level package manager used in Debian-based Linux distributions. It provides dpkg package management tool that can install any .deb file in Ubuntu. So, if you have the .deb files of the missing dependency packages, you can use dpkg to install it manually. As you have already downloaded the .deb file of libminizip1 from the Free Download section in this article, follow the below steps:

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Run the following command:

sudo dpkg -i ~/Downloads/libminizip1_1.1-8build1_amd64.deb
EXPLANATION
  • sudo: Enables administrative permission.
  • dpkg: Calls DPKG package manager.
  • -i: Option for installing a file with dpkg.
  • ~/Downloads/libminizip1_1.1-8build1_amd64.deb: Full name with the path of the .deb file of the dependency package.
DPKG manually installs missing dependencyThe above command will install the libminizip1 missing dependency.
Note: You should download .deb file of the missing dependency package that is compatible with the architecture of your system.

Method 4: Using Synaptic Package Manager to Install Missing Dependencies

Synaptic Package Manager, often referred to simply as “Synaptic“, is a GUI (Graphical User Interface) package management tool for Debian-based Linux distributions. interfaces that also handle dependencies and other package management tasks effectively. Follow these steps to install missing dependencies using Synaptic in Ubuntu:

Steps to Follow >

➊ Open Synaptic Package Manager form the Show Applications section.Open synaptic package manager from show applications.➋ Type user password in the authentication window and click Authenticate.Authenticate by entering user password.➌ Select Broken from the Custom Filters section. It will list the packages that are broken due to missing dependencies.

Right click on the package and select Mark for Upgrade.Select teamviewer and Mark for Upgrade.This will detect the missing dependencies automatically.

➎ Click on Mark.Clicking on mark for confirming installing missing dependencies.After that, Synaptic will install the detected dependencies. You can check it by clicking Reload located at the top-left of the synaptic window.

Comparative Analysis of Methods

I’ve shown four ways to install missing dependencies in Ubuntu. You might be confused to decide which one suits you the best. Here’s a comparison between the methods provided to give you an overview of the pros and cons.

Methods Pros Cons
Method 1
  • Automatically identifies all missing dependencies.
  • Installs the latest version of the dependency package.
  • Convenient syntax that doesn’t depend on the present working directory.
  • Doesn’t support multiple versions of the same dependency package.
Method 2
  • Automatically identifies all missing dependencies.
  • Resolve all dependencies and install the complete package with just the .deb file.
  • Provides both GUI and CLI.
  • Not always preinstalled. So, Users might need to install it manually.
  • Needs to be careful about package location.
Method 3 
  • Installs dependency package manually that provides more flexibility.
  • Supports installing multiple versions of the same dependency that aids software testing.
  • Version unmatching may happen while downloading the .deb file.
  • Requires to pre-download all the packages manually before installation.
Method 4
  • Automatically identifies all missing and broken dependencies.
  • Provides a user-friendly GUI that is suitable for beginners.
  • Hides internal complexity from the user.
  • May not provide core customization such as version control.

If you are comfortable with CLI and want to install missing dependencies when the installation of a .deb file is stuck, you can use Method 1 or Method 2. However, if you are not comfortable with CLI, you can use Method 5 in this situation. In the case, you have a .deb file of a package and you want to install it with all missing dependencies all at once, you should follow Method 3. Moreover, to test a software behavior with different versions of dependencies or if you have the .deb file of the dependency package, you can follow Method 4.

Common Challenges That May Arise

Although some of the package managers handle missing dependencies in Ubuntu automatically, challenges may arise sometimes. Some common challenges you might encounter and how to address them are listed below.

  • Unmet Dependencies: Some packages have dependencies that aren’t available in your configured repositories. Ensure you’re using official repositories that provide all dependencies.
  • Conflicting Packages: Conflicting or outdated packages can cause dependency issues. Run sudo apt update and sudo apt upgrade to ensure your system is up to date and packages are compatible.
  • Software from Untrusted Sources: Installing software from untrusted sources or manually downloading .deb files can lead to dependency problems. So, stick to official repositories.
  • Disk Space Issues: If your system is low on disk space, it can prevent package installation. Check your available disk space using df -h.
  • Package Cache Corruption: Sometimes, the package cache can become corrupted. Run sudo apt clean to clear the package cache and then try installing again.

Install the GDebi Tool in Ubuntu

GDebi is both a GUI (Graphical User Interface) and a CLI (Command Line Interface) based package management tool to use for installing Debian (.deb) packages on Debian-based Linux distributions. Generally, it is not preinstalled. But you can install this by the following process:

Steps to Follow >

➊ Open the Ubuntu terminal.

➋ Now, Run the following command:

sudo apt install -y gdebi
EXPLANATION
  • sudo: Enables administrative permissions.
  • apt: Uses APT package manager.
  • install: Command for installing a package.
  • -y: Answers yes to all the confirmation prompt.
  • gdebi: Name of the tool to install.

➌ Enter user password if asked.install gdebi in ubuntu.After running the above command, Gdebi tool will be installed in your system.

Conclusion

Always be cautious with manual installations and make sure to back up important data before attempting to fix complex dependency problems. However, the best practice is to use official repositories whenever possible and avoid installing software from untrusted or unofficial sources to prevent dependency issues. Using proper package management tools is essential for avoiding missing dependencies.

People Also Ask

How to install unmet dependencies in Ubuntu?
To install unmet dependencies using GUI, you can use Synaptic Package Manager. Also, you can use apt to install by the command sudo apt install <unmet_dependency>. Replace <unmet_dependency> with the actual name of the package that was unmet during the installation of the intended package.
How to install build dependencies in Ubuntu?
On Ubuntu, the first step to use apt-get build-dep is to add the source code repositories to the system source repositories. Source repositories contain the metadata necessary to find out the build-time dependencies for packages. After that, use apt for installing those dependencies whenever required.
How to install missing dependency?
If you encounter missing dependencies while installing a package, run sudo apt install -f or sudo apt-get install –fix-broken to install them.
How do I fix dependencies in Ubuntu?
To fix all the broken and missing dependencies in Ubuntu, open the terminal and run the command sudo apt -f install. It will automatically detect and fix dependency issues.
How to install all dependencies?
If you want to install all dependencies during a package installation, use apt to install the package. The command syntax is sudo apt install <pacakge name>. But if you want to install a .deb file with all dependencies, install GDebi by sudo apt install gdebi. Then use it with the command sudo gdebi <package.deb>. Replace <package.deb> with the actual name of the .deb file.

Related Articles


<< Go Back to Dependencies in Linux | Package Management in Linux | Learn Linux Basics

4.9/5 - (9 votes)
Ashikur Rahman

Hello, I’m Ashikur Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation in Computer Science and Engineering from Khulna University of Engineering & Technology (KUET). Also, I’m pursuing my master’s in the same department at Bangladesh University of Engineering & Technology (BUET). I like to learn new technologies, contribute, and share those with others. Here my goal is to provide beneficial and user-friendly articles on Linux distribution for everyone. Read Full Bio

Leave a Comment