FUNDAMENTALS A Complete Guide for Beginners
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
- System running on Ubuntu.
- Sudo privileges to use the core functionality of package managers.
- Installed GDebi tool in your Ubuntu.
- Synaptic Package Manager in your Ubuntu.
Process Flow Chart
[Distro Used Throughout the Tutorial: Ubuntu 22.04.1 LTS]
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
- cd: Command to Change Directory.
- ls: Lists all the files and folders in the mentioned directory.
- ~/Downloads/: Absolute path of Downloads folder.
➌ Now, try installing the .deb file by the following command:
sudo dpkg -i teamviewer_15.43.7_amd64.deb
- 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.
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.
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
- 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.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
- 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.The 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
- 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.
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.➋ Type user password in the authentication window and click Authenticate.➌ 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.This will detect the missing dependencies automatically.
➎ Click on Mark.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 |
|
|
Method 2 |
|
|
Method 3 |
|
|
Method 4 |
|
|
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
- 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.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
Related Articles
- How To Check Package Dependencies in Linux [3 Easy Ways]
- How to Install Dependencies Using dpkg? [Easiest Solution]
- Install Dependencies Automatically in Ubuntu [3 Exclusive Methods]
- 5 Methods to Remove Package and Dependencies in Ubuntu
- How to Install RPM Package With Dependencies? [3 Methods]
- 2 Ways to Install RPM Without Dependencies in Linux
- How to Check RPM Reverse Dependencies in Linux? [4 Methods]
- [Solved] RPM Failed Dependencies Error in RedHat
- 2 Methods to Install YUM Packages with Dependencies
- Remove Packages without Dependencies Using Yum [2 Methods]
- [Solved] The Following Packages Have Unmet Dependencies Error
- How to Check APT Dependency Tree in Linux? [4 Methods]
<< Go Back to Dependencies in Linux | Package Management in Linux | Learn Linux Basics