Ubuntu is renowned for its ease of use and capable package management system. The Ubuntu Software Centre allows simple one-click access to popular apps.
However, there are instances when you need to install applications that are not available at the Software Center. In this situation, you need the .deb file (also known as a package) to install the application on your Ubuntu system.
Deb files (packages) are a popular way of packaging all the required assets in a single file used to install applications on Ubuntu and other Debian-based distributions.
This guide will walk you through installing deb files on Ubuntu systems. Let’s start with a short overview of the deb packages.
Table of Content
- What are Deb Packages?
- Benefits of Using Deb Packages
- Prerequisites to Installing Deb Packages on Ubuntu
- Use the GUI to Install Deb Files On Ubuntu
- Install Deb Files From the Terminal
- How to Uninstall Deb Packages
- Conclusion
- FAQs
What are Deb Packages?
Debian-based operating systems like Ubuntu and Linux Mint use software packages known as deb packages (short for Debian packages). These packages include all files (including executables, scripts, and configuration files) required to install and run software.
Deb packages can be installed using various tools, such as package managers (like APT) and the dpkg command.
Developers use these files to easily distribute and install a wide range of software on Debian-based systems. The structure of deb files ensures that all prerequisites are satisfied and configuration files are handled correctly.
Deb packages provide a dependable and effective way to manage software repository installations on your Ubuntu or Linux Mint operating system. In effect, these files simplify the process of downloading packages from external repositories and manually installing package files.
Benefits of Using Deb Packages
Deb files offer various benefits, such as:
Flawless Installation Experience
Deb packages offer an easy and efficient installation procedure, allowing users to quickly install applications by double-clicking the package file. Users no longer need to manually download and install new files for software updates.
Effective Package Management
Deb packages ensure a clean and properly organized system by ensuring automatic installation and removal of packages. Package managers like dpkg and APT on the Ubuntu systems handle this process.
These package managers resolve package dependencies, sparing users from the hassle of finding and installing necessary libraries or components manually.
Trusted Dependency Resolution
Package managers handle all underlying dependencies and ensure all necessary components are installed on the system. This prevents broken installation and similar dependency problems from affecting user experience.
Smooth Updates
Deb packages simplify the process of updating installed applications. The package managers fetch the most recent versions from the relevant package repository. Users can access the latest features, bug fixes, and security patches, ensuring their applications are up-to-date.
Due to these advantages, deb packages are commonly preferred for installing packages on Ubuntu and other Debian-based operating systems.
Prerequisites to Installing Deb Packages on Ubuntu
Before you install Deb packages on Ubuntu systems, you need to make sure that you have the following:
-
-
- A system running Ubuntu.
- Access to a terminal window.
- A root user or a user with sudo rights
-
Use the GUI to Install Deb Files On Ubuntu
The Ubuntu GUI greatly simplifies the process of installing deb packages. We’ll describe the two most popular methods of installing deb packages via the GUI.
Method #1: Use the Software Center
Follow these easy steps to install a deb package using Ubuntu Software’s default Software Center:
The first step is to locate the deb package. Usually, the system saves the downloaded files in the Downloads directory.
Right-click the deb file and select Open with Another Application from the context menu. Choose Software Install from the program list. To proceed, click the Install button.
When requested, enter the password and click Authenticate.
Wait for the installation to finish. When complete, the software is ready for usage.
Method #2: GDebi GUI
GDebi is a simple utility for installing local Debian packages. The utility also detects all essential dependencies and downloads and installs them automatically using the APT package manager. GDebi is accessible as a command-line and graphical interface user application.
Note that GDebi is not installed by default on Ubuntu systems. We recommend using the following command to install it:
# sudo apt-get install gdebi -y
Once the installation finishes, the utility is ready for deb file installation. Follow these steps to install a deb package using the GDebi GUI:
-
-
- Launch the file manager and browse to the deb file.
- Right-click and choose Open With Other Application from the context menu.
- Click GDebi Package Installer to select the option.
-
-
-
- The installer loads the deb package and displays a description of the software. Click Install Package to begin the installation process.
-
-
-
- When prompted, enter the password and hit Enter.
- Wait for the installation to finish. The software is now ready for use.
-
Install Deb Files From the Terminal
The Ubuntu terminal lets you install packages using various package managers and commands. You can use the following commands and utilities in the terminal to install deb packages on Ubuntu.
Method #1: Use The dpkg Utility
The dpkg command is the Debian package manager that allows you to install, remove, and build packages.
Run the following command to install a deb package with the dpkg utility:
# sudo dpkg -i <package path> (Absolute path)
Enter the user’s password and wait for the installation to finish.
The dpkg utility returns an error if a package depends on unavailable dependencies. If you encounter this error, we recommend manually downloading the missing dependencies.
Method #2: Install Deb Files Through the APT Package Manager
The apt command launches Ubuntu’s APT package management utility.
Run the following command to install a deb package with the apt utility:
# sudo apt install <package path>
If requested, enter the user’s password. The package manager will also automatically find and install any secondary dependencies.
Method #3: Use the GDebi Package Installer
GDebi can also be used as a command-line tool to install packages. Run the following command in the terminal to install a deb package with GDebi:
# sudo gdebi <package path>
After downloading the required dependencies, the command will ask your permission to install the package. Press Y to give permission and enter the user’s password.
How to Uninstall Deb Packages
Ubuntu offers several methods for uninstalling a previously installed deb package. The process of removal is determined by how the package was previously installed.
The default options for removing deb packages from the system are shown below.
Method 1: Use the Software Center
To remove a deb package using the Ubuntu Software Center, perform the following steps:
1. Launch the Ubuntu Software.
2. Go to the Installed tab.
3. Find the software you wish to uninstall. To uninstall the application, select Remove.
4. Confirm the uninstallation and provide the user’s password to complete the software removal.
Method 2: Use the GDebi GUI
To uninstall software using Gdebi, follow these steps:
-
-
- Find the .deb package file on your system.
- Select Open With Other Application from the context menu.
- From the options, select GDebi Package Installer.
- To uninstall the software, click Remove Package.
-
-
-
- Enter the user’s password and wait for the uninstall to finish.
-
Method 3: Use the dpkg Command
Use the following command in the terminal to uninstall packages installed with the dpkg utility:
# sudo dpkg -r <package name>
Important: Remember to use the official package name (not the .deb file name) in the command.
Method 4: Remove Packages with the APT Package Manager
Run the following commands to uninstall a package using the apt command:
# sudo apt remove <package name>
To confirm the removal, press Y.
This method would work if you installed Ubuntu through the Ubuntu Software Center or the APT package manager.
Conclusion
This guide goes into the details of how to install deb files on Ubuntu. You need to be careful about the source of the package. While deb files provide flexibility, consider utilizing the Ubuntu Software Centre or APT for a simpler package management experience because they handle dependencies and updates effortlessly.
If you’re looking for a robust server for your Ubuntu projects, RedSwitches offers the best dedicated server pricing and delivers instant dedicated servers, usually on the same day the order gets approved. Whether you need a dedicated server, a traffic-friendly 10Gbps dedicated server, or a powerful bare metal server, we are your trusted hosting partner.
FAQs
What is a .deb package file type?
A .deb file is a Debian software package used in Debian-based Linux distributions like Ubuntu. It contains all the files needed for a particular software application and metadata about the package.
Why would I need to install .deb files on Ubuntu?
You may need to install .deb files on Ubuntu when a specific application or software package is unavailable in the official Ubuntu repositories or a PPA (Personal Package Archive). Also, install software downloaded from the internet in .deb format.
How do I install a .deb package file on Ubuntu?
You can install a .deb file on Ubuntu using the dpkg or apt command. Here’s how:
Using dpkg: Open a terminal window and navigate to the directory containing the .deb file. Run the command sudo dpkg -i filename.deb, replacing filename.deb with the actual name of the .deb file.
Using apt: Run sudo apt install ./filename.deb, replacing filename.deb with the actual file name.
What’s the difference between dpkg and APT for installing .deb files?
dpkg is a lower-level package management tool that installs and manages .deb files directly without resolving dependencies. It’s useful for basic package installation but doesn’t handle dependencies automatically. APT, on the other hand, is a higher-level tool that resolves and installs dependencies while also managing the package repository.
How do I resolve dependencies when installing .deb files?
If your .deb file has unmet dependencies, you can use the apt command with the -f flag to automatically resolve and install missing dependencies. For example, run sudo apt -f install after attempting to install the .deb file.
Can I uninstall a .deb package later?
You can uninstall a .deb package using the dpkg or apt command. For dpkg, use sudo dpkg -r package name. For apt, use sudo apt remove package-name.
What if I encounter a Dependency error during installation?
If you encounter errors during installation, they are often related to missing dependencies. Make sure to resolve dependencies first. If you still have Dependency issues, you may need to seek help in Ubuntu forums or communities.
Is it safe to install .deb files from untrusted sources?
Installing .deb files from untrusted sources can be risky, as they may contain malware or harm your system. It’s generally recommended to only install software from official Ubuntu repositories, trusted PPAs, or reputable sources.
Can I upgrade .deb packages using apt?
Suppose you’ve installed a .deb package using apt. In that case, it will be managed like any other package from a repository, and you can upgrade it using sudo apt upgrade when updates are available.
Where can I find .deb files for Ubuntu?
You can find .deb files for Ubuntu on the official websites of software providers, third-party repositories, or by building them from source code using tools like checkinstall. Be cautious and make sure the source is reliable.