📜  dpkg install deb with dependencies - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:00:32.038000             🧑  作者: Mango

dpkg Install Deb with Dependencies - Shell/Bash

Introduction

When installing a Debian package (.deb file) using dpkg, it also has dependencies that must be satisfied in order for the package installation to succeed. This tutorial will show you how to install a .deb file with dependencies on the command line using dpkg.

Prerequisites

To follow this tutorial, you should have access to a terminal window with Shell/Bash installed on a Debian-based distribution, such as Ubuntu or Debian.

Steps
  1. Download the .deb file and save it to a directory on your system.

  2. Open a terminal window and navigate to the directory where the .deb file is located.

  3. Run the following command to install the package and its dependencies:

sudo dpkg -i package-name.deb
sudo apt-get -f install
  • The first command installs the package and its dependencies.
  • The second command runs apt-get with the -f (or --fix-broken) flag to fix any broken or missing dependencies that were not installed.
  1. If there were any missing dependencies, apt-get will prompt you to install them. Type Y to confirm and install the missing dependencies.

  2. Once the dependencies have been installed successfully, you can verify that the package and its dependencies are installed correctly by running:

dpkg -s package-name
  • This command will show you the status of the package and its dependencies.
Conclusion

In this tutorial, you learned how to install a Debian package with its dependencies using dpkg on the command line. By following these steps, you can ensure that all the required dependencies are installed and the package is installed correctly.