HOWTO: Use dpkg to Install .deb Files.
I’ve written about using apt-get to get and install debian packages. However, a recent comment by a reader brought the fact that I hadn’t written anything on what to do with a .deb file that exists on your system already either by download or other media.
Using the apt-get application is the quickest way to find and install debian packages. The installation part is done by an application named dpkg. Dpkg doesn’t have to be used by apt-get, you can use it manually as well.
From the man dpkg command:
dpkg - a medium-level package manager for Debian
Whatever that means.
In keeping with GNU/Linux system security, only the superuser can use the dpkg application. Dpkg is a typical GNU/Linux application that is controlled by command-line switches. Possibly the most common use of dpkg is to install a local .deb file.
To install a .deb file, become root and use the command:
dpkg -i filename.deb
Dpkg can also be used to:
- dpkg –unpack: unpacks the file but does not install it
- dpkg –configure: presents whatever configuration options are available for the package
- dpkg –remove: removes a package
Some of the package manipulation commands are actually carried out by an application called dpkg-deb. In those cases, dpkg just acts as a front end to dpkg-deb and passes the commands to it.
Dpkg-deb can also be used to manipulate .deb files. Some of the more useful commands of dpkg-deb are:
dpkg-deb –show filename.deb
This will display the information for filename.deb. Normally, this is boring information like the application version (which is normally evident from the filename), but in some cases more interesting and useful information is displayed.
Consult the dpkg man page for information on the more arcane uses for dpkg.
Related Stories
POSTED IN: How To
46 opinions for HOWTO: Use dpkg to Install .deb Files.
Oliviu
Nov 27, 2005 at 11:42 am
Hi Jon,
That’s the answer I was looking for.
Thank you for the swift and competent response.
As a Linux newbie that I am, I spent a little more time reading the net and man help files and finally found out about the dpkg command
just had to Read The Fine Manual ;).
Regards,
Oliviu
Jon
Nov 27, 2005 at 11:54 am
Right on, glad it helped!
Bart
Nov 28, 2005 at 8:56 am
Fond it at last.
Just wanted to install a .deb file on several machines without having to download in every time again.
apt-get is a magnificant tool, nevertheless.
Thanks.
Jon
Nov 28, 2005 at 9:08 am
It seems that a few people were looking for this information. I really don’t know how I could have missed covering off dpkg when I did apt-get…sheesh.
Sorry guys!
shane
Dec 15, 2005 at 1:12 pm
I get some dependency errors while trying to use dpkg. Anyone have info on that?
Jon
Dec 15, 2005 at 1:36 pm
What’s the package you’re trying to install?
I ask because dpkg by itself isn’t able to resolve dependency issues. However, apt-get will (in most cases) resolve dependency issues for you. If you’re trying to install a *.deb that is available in the repositories, you may be able to ‘apt-get install package’ instead of dpkg’ing the local file and get it working.
shane
Dec 15, 2005 at 2:33 pm
I am trying to install Opera 8.51.
It is not available via the repositories as far as I can tell and dpkg gives me dependency problems that I am not entirely sure how to resolve. It ends up just breaking the package.
It’s not a huge deal if I can’t get Opera working obviously, but I would feel alot better if I knew how to resolve this in general.
Pieter
Jan 23, 2006 at 1:10 pm
all what i need is a complet, dutch, FAQ, forum, …. where i can find help. i’m only 14 years old, my english is very bad. Thanks for this explanation over the dkpg command!!!!!!!!!!
Jon
Jan 23, 2006 at 1:14 pm
Hi Pieter.
I wish I spoke Dutch, I would translate for you. But I don’t… :(
jacques
Mar 9, 2006 at 5:08 pm
for the dutch-ees
dit zijn nederlandstalige nieuwsgroepen op usenet (nntp)
nl.comp.os.linux.discussie
nl.comp.os.linux.overige
nl.comp.os.linux.netwerken
nl.comp.os.linux.installatie
en hier vind je heel wat nederlandstalige info
http://doc.nl.linux.org/
http://www.nluug.nl/
succes joh
Done!
May 11, 2006 at 3:12 am
“dpkg -i filename.deb”
that’s work good
(i click some sponsors:P) Thank you.
thepumpkin1979@gmail.com
Jon
May 11, 2006 at 5:24 am
Thanks Done!
:)
Josh
May 28, 2006 at 7:34 pm
Thanks for this info! I am yet another semi-newbie that was searching to figure out which command would allow installation from a local .deb.
On the topic of conflicts/missing dependencys with dpkg, once it coughs up a missing dependency, I will usually just apt-get install the missing package that dpkg complained wasn’t there, before running the dpkg -i .deb command again. It seems to work fairly well, unless you find something that wants a specific *version* of the file and that version is no longer there.. (Aqualung.. :p )
Thanks again!
Jon
May 30, 2006 at 5:09 am
Hey Josh,
Glad this helped. I use the same tactic as you and in many cases it works. Every now and again it fails if the dependency either doesn’t exist in the repository or is too many levels deep, but most of the time it works :)
Shailesh Solanki
Jun 15, 2006 at 9:33 pm
i want to install .deb package in redhat fedora.plz specify
Jon
Jun 16, 2006 at 9:59 am
Hi Shailesh,
Well, a .deb package isn’t made for Red Hat or Fedora. RH and Fedora are both RPM-based distros so you should try to find an .rpm package for them.
However, if you’re completely stuck and all you have in a .deb, then you can probably use the application ‘alien’ to turn it into a .deb and then install it as per the dpkg instructions I’ve provided.
Alien: http://www.newlinuxuser.com/howto-install-an-rpm-package-on-a-debian-box/
Lutfi
Oct 15, 2006 at 11:06 pm
As it is said, that is exactly what i’m looking for,
Thanks
cas
Jan 30, 2007 at 1:06 pm
After fiddling with some issues.. this solved my problem… Thanks…
Velo, Rapido: Going Places » Blog Archive » I might hate my computer but I love my blog (and Marius)_
Mar 2, 2007 at 2:22 pm
[…] If you are studying apt and dpkg, here is a nice how-to that got me over that particular hump. […]
lou graue
Mar 9, 2007 at 2:48 pm
How can I install kmymoney on my Ubuntu system? I have downloaded a .rpm version but that will not work.
bramgn
Mar 18, 2007 at 6:36 am
try running the command “apt-get install –fix-broken” after you have installed a ‘local’ package with “dpkg -i “. It will try to install the needed dependencies from its repository.
g.
Apr 16, 2007 at 4:38 am
hi
nice and very useful info!
but there’s a little typo. it should be:
dpkg-deb –-show filename.deb
note the extra -.
/g.
Ronald S.
Apr 20, 2007 at 12:41 pm
(linux version:6.02.6.14-kanotix-6)
when i try, for example:
# sudo dpkg –install –force-all klavaro_1.0.2_i386.deb
i get…
dpkg: syntax error: unknown group ‘cdrom’ in statusoverride file
May you help me?
Thanks for your attention.
Zam
Apr 23, 2007 at 9:59 am
Thanks for this, its a quick & easy solution to what i wanted ;)
Thanks man =D
Sam
May 15, 2007 at 1:57 pm
Hi,
I have an i386 deb file, is it possible to install on a amd64 (ubuntu) system?
/S
Thu Tu’s Blog » How to Install Applications on Linux
May 29, 2007 at 9:23 pm
[…] found this page today that finally helped me understand how to install applications in Linux: HOWTO: Use dpkg to Install .deb Files: To install a .deb file, become root and use the command: dpkg -i […]
Iain Houston
Jun 6, 2007 at 3:42 pm
if a deb file is corrupted what is the way to delete it and refresh it from perhaps a different mirror … using the dpkg tool or synaptic to maintain the package database?
Jordon Fenton
Jun 17, 2007 at 10:31 pm
Heya!
Alright, seems to be working for everyone else…. Issue Im having while running the command via the Terminal, is every .deb file im attempting to install:
dpkg: requested operation requires superuser privilege
What pisses me off, is the fact that I believe that Im using a horrible Distro of linux “FREESPIRE”
What is the issue that I am having? ANY addl. comments, PLEASE forward to me, twitch_ns@hotmail.com
Im running FreeSpire on my HP Pavillion zt1260 Pentium 4, 40GB HD, attempting to install Alien for Running/repackaging RPM file(s) to *.deb.
trevisa
Sep 25, 2007 at 2:45 pm
How do I install the DPKG itself?
Stranger
Oct 15, 2007 at 9:49 pm
dpgk is already installed. But man dpkg is not working. If you write > whereis dpkg you will see that it is included in debian and its path. So everything is workin. thanks.
Lean 946
Oct 16, 2007 at 12:00 pm
Hi, Jordon Fenton:
To become a root user without being one, you can type “sudo” before the commands.
lean.946@gmail.com
PD: Thanks for the help with the dpkg utility!!!
bramgn
Oct 17, 2007 at 12:10 am
Lean: sudo is a great utility for doing just those tasks which require root privileges without having to actually ‘become’ root. Before one is able to use sudo, though, you have to specifically tell sudo that you are allowed to use it. With the command visudo you can edit its configuration by adding your username (or alternatively comment out the group which is allowed to use sudo; make sure you are in that group).
Reporter
Oct 21, 2007 at 5:45 pm
If the .deb file is downloaded to the desktop you can just click on the .deb icon, select open and the Package Installer will take care of it for you.
Sx66gns
Dec 19, 2007 at 10:04 pm
Thanks for this site , it’s great , I like the human humor as well , this tip simple as it is helped me , thank you , keep up the good work.
Lawrence
Dec 20, 2007 at 3:20 pm
Glad its worked for you guys. I have managed to install it using Kate from freespire 2.0.8 and the terminal reads setting up [filename]…
but then what happens? Where is it. Thats seems to be the last that happens and I dont know how and where to open it.
U had to first convert my tight vnc server from rmp file to a deb file using alien.cdr and the go into root and install the deb file. can anyone help me! Cheers.
Correction
Jan 24, 2008 at 5:07 pm
There is an error in this article. It should be “dpkg –show filename.deb” (note the double hyphen). Otherwise, thanks for the tips!
naveen
Feb 23, 2008 at 6:56 am
just can you say something deep about how dpkg will prepare and what are all the steps that it would perform before and after installation of an .deb files.
mustakim
Feb 28, 2008 at 5:24 pm
how to install many deb in one command? I don’t need aptoncd, I just want to learning how to install over 50 units of deb in one command in terminal. sudo dpkg -i package.deb just only install one by one. Any ideas?
Ravi Kant
Mar 7, 2008 at 5:33 am
hi
Well I am trying to install qt package for Debian kernel 2.6
I downloded qt3-designer_3.3.4-3sarge3_i386.dep package
while using command
apt-get install qt3-designer_3.3.4-3sarge3_i386.dep
The message displayed is
Reading package lists… Done
Building dependency tree… Done
E: Couldn’t find package qt3-designer_3.3.4-3sarge3_i386.dep
After trying with command dpkg -i qt3-designer_3.3.4-3sarge3_i386.dep
(Reading Database …. 66812 files and directories currently nstalled)
Preparing to replace qt3-designer 3:3.3.4-3sarge3 (using qt3-designer_3.3.4-3sarge3_i386.dep ) …
Unpacking replacement qt3-designer …
dpkg-dep: subprocess paste killed by signal (Broken pipe)
dpkg: error processing qt3-designer_3.3.4-3sarge3_i386.dep (–install):
returned error exit status 2
Errors were encountered while processing
qt3-designer_3.3.4-3sarge3_i386.dep
Ravi Kant
Mar 7, 2008 at 5:34 am
What is the problem and how could it be sorted out.
kindly reply at ravikantbansal2004@gmail.com
naveen
Mar 10, 2008 at 12:24 am
hi,
can you say about how dpkg would build the dependence tree before installing a package.
O2O
Mar 19, 2008 at 9:26 am
I’ve just used Ubuntu. So It’s too difficult.
When i type: sudo apt-get install -f
—>
o2o@o2o-desktop:/root$ sudo apt-get install -f
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
So, can you help me fix it?
Thanks!!!
Luis
Mar 28, 2008 at 1:59 pm
I have two .deb files. When I try to install them they ask for a dependency, but package 1 needs package 2 and vice versa. I thought I could install them together but I dont know how to do it, can someone help me? Thank you.
Carlos Jones
Apr 17, 2008 at 4:46 pm
I had some troubles installing Asterisk on ubuntu and needed to install libncurses5-dev, this post helped me to solve the situation. Thanks a lot.
Metal Shaper Man’s Blog
Apr 19, 2008 at 3:23 am
[…] Article on what to do with .deb files […]
CrazyGangster
Jun 5, 2008 at 5:17 am
Hii everyone
I try install Virtual Box in Damn Small, it’s possible?
Thanks
Have an opinion? Leave a comment: