What is a DEB file? Files that contain the.deb file extension are Unix archive files. These files are most commonly used for installation packages that contain software that was developed for computers that run on the Linux operating system using the Debian package management application. Once upon a time, Ubuntu used archive manager for installing.deb files but with time it changed and now Software Center is the default application for installing DEB files. Now, if you are just trying to install a.deb file, I would not recommend using the Software Center. Below you will get the Official Direct Download Links of Cydia Application Installer Package.DEB File for Free and Guide and Tutorial on How to Manually Install Cydia Application Installer Package on Jailbroken iPhone, iPad and iPod Touch devices.
I have a deb package for installation.
Shall I install by dpkg -i my.deb
, or by apt?
Will both handle the software dependency problem well?
If by apt, how can I install from the deb by apt?
g_p8 Answers
When you use apt
to install a package, under the hood it uses dpkg
. When you install a package using apt, it first creates a list of all the dependencies and downloads it from the repository.
Once the download is finished it calls dpkg
to install all those files, satisfying all the dependencies.
So if you have a .deb
file:
You can install it using:
You can install it using
sudo apt install ./name.deb
(orsudo apt install /path/to/package/name.deb
).With old
apt-get
versions you must first move your deb file to/var/cache/apt/archives/
directory. For both, after executing this command, it will automatically download its dependencies.Install
gdebi
and open your .deb file using it (Right-click ->Open with). It will install your .deb package with all its dependencies.(Note: APT maintains the package index which is a database of available packages available in repo defined in
/etc/apt/sources.list
file and in the/etc/apt/sources.list.d
directory. All these methods will fail to satisfy the software dependency if the dependencies required by the deb is not present in the package index.)
Why use sudo apt-get install -f
after sudo dpkg -i /path/to/deb/file
(mentioned in first method)?
From man apt-get
:
When dpkg
installs a package and a package dependency is not satisfied, it leaves the package in an 'unconfigured' state and that package is considered broken.
sudo apt-get install -f
command tries to fix this broken package by installing the missing dependency.
Install your foo.deb
file with dpkg -i foo.deb
. If there are some errors with unresolved dependencies, run apt-get install -f
afterwards.
Here's the best way to install a .deb
file on Ubuntu on the command-line:
If you don't have gdebi
installed already, install it using sudo apt install gdebi-core
.
gdebi
will look for all the dependencies of the .deb
file, and will install them before attempting to install the .deb
file. I find this much preferable than sudo dpkg -i skype.deb && sudo apt install -f
. The latter is much too eager to remove dependencies in certain situations. For instance, when I tried to install Skype, it attempted to remove 96 (!) packages, including packages like compiz
and unity
! gdebi
gave a much clearer error message:
(Here is the solution to that particular issue, by the way.)
You can install a local .deb package by:
Make sure to specify a local relative or absolute path (./
if in current dir), otherwise it will look for foo.deb
in the remote repos and fail.
Check the dependencies with dpkg -I my.deb
and apt-get install
the dependencies before dpkg -i my.deb
.
May be you can copy the Doesn't work, my.deb
in /var/cache/apt/archives
and install it directly with apt-get
but I never tried.apt-get
and dpkg
are looking for packages listed in archives.
The simplest answer would be to use dpkg by running dpkg -i packagename.deb
. You could then uninstall it by running dpkg -r packagename.deb
.apt-get
is a higher level installer based off of dpkg, and as such you could apt-get install packagename.deb
.
It would be beneficial for add it to your apt-get archives directory (/var/cache/apt/archives
) so you could reference it as a package with dependencies and not a standalone .deb archive.
Also, by adding it to your apt-get archives directory, you have the opportunity to use dependencies with apt-get install packagename
. This would let you install it with any manually added dependencies instead of dpkg's standalone archive-based system.
Modern apt-get can be used to install a package simply with apt-get install /path/to/package/name.deb
.
(should be done as edit to the top answer but it was rejected - see https://unix.stackexchange.com/posts/159114/edit)
It is very simple if I want to install Chrome.
Install your Chrome file as:
Sometimes there is a chance of getting some dependency errors like the following:
So to resolve above issues, you need to add dependencies; give the following command:
After giving the above command, dependencies will be added to your machine and your Debian package (.deb
) file will be installed.
protected by Community♦Nov 6 '15 at 13:57
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged software-installationaptdpkgdeb or ask your own question.
Every Linux distribution based on Debian uses Debian packages as a method for installing and uninstalling the software. Debian packages are identified by the file extension .deb. They can be installed and uninstalled using graphical tools and the command line.
Why Install a .deb File Manually
Most of the time you use a package manager such as the Ubuntu Software Center, Synaptic, or Muon to install the software in Debian-based distributions. If you prefer to use the command line, you are likely to use apt-get.
Some applications aren't available in the repositories and have to be downloaded from the vendors' websites. Be careful about downloading and installing Debian packages from sources that do not exist in the distribution's repositories.
Some of the biggest applications are delivered in this format, including Google's Chrome web browser. For this reason, it is important to know how to install the packages manually.
Where to Get a .deb File
For demonstration purposes, you need a .deb file to install.
This example uses the .deb file for a QR Code Creator. A QR code is one of those funny-looking symbols you see just about everywhere. When you focus on the QR Code with your mobile device, it takes you to a web page, almost like a hyperlink.
On the QR Code Creator page, there is a .deb file. Clicking on the link downloads the .deb file to your downloads folder.
How to Install .deb Packages
The tool used to install and uninstall Debian packages is called 'dpkg.' It is a command line tool. Through the use of switches, you can do many different things with it.
The first thing you want to do is install the package. Type the following into the command line:
For example to install the QR Code Creator the command is as follows:
If you prefer, you can also use --install instead of -i as follows:
What Happens If It Breaks?
When you install a any type of package on a Linux system, there's a good chance that it's going to depend on other packages, often called dependencies. Dpkg doesn't have automatic dependency resolution, meaning that it won't pull the packages that your package requires. Often times, this leads to errors when installing a .deb package with dpkg.
There's a simple solution. After your install fails, run the following command to use the Apt package manager, which does have dependency resolution, to sort out the mess and fix anything that's broken.
You can shorten that to:
Apt will clean up what dpkg broke, and install both your package and its dependencies.
Installing With Apt
You do have another option when it comes to installing .deb packages on your system. The Apt package manager, the same one you use to update your system and install new packages from the Web, can also install packages locally on your system.
As previously discussed, Apt has the advantage of automatic dependency resolution, so you won't need to worry about things ever breaking in the first place. Apt will handle both your package and anything that it may need.
To use Apt, simply point it in the direction of whichever .deb package you want to install.
If you want to play it extra safe, you can add the 'fix broken' flag from before to ensure that Apt gets everything.
What Is in a .deb File?
If you have ever wondered what makes up a .deb package, you can run the following command to extract the files from a package without installing it.
This command extracts the contents of the qr-code-creator package into a folder called qrcodecreator located in the home folder (/home/qrcodecreator). The destination folder qrcodecreator must already exist.
In the case of qr code creator, the contents are as follows:
- usr
- usr -> bin
- usr -> bin -> qr-code-creator
- usr -> share
- usr -> share -> applications
- usr -> share -> applications -> qr-code-creator.desktop
- usr -> share -> doc
- usr -> share -> doc -> qr-code-creator
- usr -> share -> doc -> qr-code-creator -> changelog.gz
- usr -> share -> doc -> qr-code-creator -> copyright
- usr -> share -> man
- usr -> share -> man -> man1
- usr -> share -> man -> man1 -> qr-code-creator.1.gz
- usr -> share -> pixmaps
- usr -> share -> pixmaps -> qr-code-creator.png
- usr -> share -> qr-code-creator
Removing .deb Packages
Remove a Debian package using the following command:
If you want to remove the configuration files as well, use the following command:
File Extension Deb Download
Apt can handle these too, and you won't need to remember the whole version number, just the actual name of the package.
Open Deb File
If you are using a Ubuntu-based distribution, just double-click on the .deb file, and it loads into the Software Center. Then, click install.