In Linux, dpkg stands for “Debian Package”. It is a command-line tool used for installing, configuring, and removing software packages in Debian-based Linux distributions such as Debian, Ubuntu, and their derivatives. The dpkg command is responsible for managing the individual software packages in a Debian-based Linux system.
This article has briefly explained the step-by-step instructions to install dependencies automatically.
How to let dpkg Install Dependencies Automatically?
Users can prevent multiple problems such as missing files or libraries, packages that donβt work as expected, and many more. The step-by-step procedure to install dependencies automatically is provided below.
Step 1: Install Dependencies Automatically
To install dependencies with dpkg, users can utilize the β-fβ option to fix broken dependencies. In this way, the βaptβ package manager installs any missing dependencies automatically by executing the below command:
$ sudo apt install -f
The above command installs all dependencies if the system is required. In our case, all the dependencies are already installed in the system.
Step 2: Download .deb Package File
Users can download any Debian file to install the package in the operating system. In our case, download the βGoogle Chromeβ package file that is supported to Linux from the official website:
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
The output shows that the Debian package of βGoogle Chromeβ has been downloaded.
Step 3: Install .deb Package File
Users can utilize the βdpkgβ command with the β–iβ option to install dependencies automatically. In our case, specify the package name βgoogle-chrome-stable_current_amd64.debβ in the below script:
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
The output shows that dependencies of the βgoogle-chrome-stable_current_amd64β package have been installed automatically in the system.
Step 4: Verify Google Chrome
To verify all dependencies are installed automatically, users can utilize the βversionβ option by specifying the package name. For instance, specify the βgoogle-chromeβ to check the installed version:
$ google-chrome --version
The output authenticates that the βGoogle Chrome 110.0.5481.96β have been installed along with all dependent files.
Conclusion
To install dependencies with dpkg, users execute the βsudo apt install -fβ command in the terminal. It ensures that all the required packages are installed on the system. After that, users can install any Debian package by executing the βdpkg–i <pacakge_name.deb>β command.
This guide has briefly demonstrated the step-by-step procedure to install the package along with dependencies automatically.