To install a .deb file via the command line in a Debian-based system (like Ubuntu), follow these steps:
- Open a terminal window.
- Navigate to the directory where the .deb file is located using the
cdcommand. For example, if the file is in your “Downloads” folder, you can type:
- Install the .deb package using the
dpkgcommand followed by the
-i(install) flag and the name of the .deb file. For example, if the file is named “example-package.deb”, you would type:
sudo dpkg -i example-package.deb
- If the installation requires additional dependencies, you might encounter errors. To resolve these dependencies, run the following command:
sudo apt-get install -f
This command will automatically try to fix broken dependencies by downloading and installing the required packages.
- After resolving the dependencies, the package should be installed successfully. You can verify its installation by checking its version using the
dpkgcommand with the
-l(list) flag and the package name. For example:
dpkg -l example-package
Remember to replace “example-package” with the actual name of the package you installed.