HOWTO: Install *.deb *.rpm and Source Code Files.

Posted in Technology
Fri, Sep 30 - 12:10 pm EDT | 13 years ago by
Comments: 53
Be Sociable, Share!
Use Arrow Keys (← →) to Browse

In a very broad sense, GNU/Linux applications are distributed in two formats: source code and distribution-specific packages.

See Primer on Programming post.

The concept of distributing an application as source code seems foreign to many computer users, but it is extremely logical.

It is usually preferable to find a distribution specific package of the application for your distribution first. Only hunt for source code if you have a reason to such as there is no package for your distro, or the source code version is more up to date than the package version.

Distribution Specific Packages

Possibly the two most common packages out there are Debian and Red Hat style packages. There are others such as Slackware, but Debian and Red Hat are probably the most common.

Debian style packages end in the extension .deb and Red Hat style packages end in the extension .rpm. In general, if you are running a Debian-based system (like Ubuntu, Kanotix, or Debian itself) you should look for a *.deb package for the application; if you’re running a Red Hat-style system (like Fedora, SUSE, or Red Hat itself), then you should look for a *.rpm package for the application.

The words ‘In general’ are emphasized above because some distributions have gone so far off the mainstream track of their flavour that this rule does no apply. For example, Ubuntu is a Debian-based distribution and therefore you should be able to use a *.deb package to install an application. However, Ubuntu has strayed so far from the core Debian stream that there are some *.deb packages that won’t work on Ubuntu. Therefore not only do you want to look for a *.deb package for your Ubuntu but you also want to look specifically for an Ubuntu *.deb package. Attempting to install a standard *.deb package may or may not work.

I am not picking on Ubuntu – this same situation exists for many distros.

You may also have some luck grabbing the proper *.deb or *.rpm from your package manager.

In the terminal window of a Debian-based system (as root), type:

apt-get install application_name

In the terminal window of a Red Hat-based system (as root), type:

yum install application_name

If you’re successful, the application will download and install itself and you’re done.

Source Code

Source code is generally distributed as a tar archive which is usually referred to as a ‘tarball’. The advantage of compiling source code over installing a package is that the application will be built to your specific system. The disadvantage is that your system may not have all of the dependent packages that it requires in order to actually install or run the application. The activity of trying to install any required dependencies for an application is sometimes referred to as ‘dependency hell’ because it can be quite labourious.

Tarballs are generally archived in one of two ways: BZipped (usually has an extension of or .tbz) or GZipped (usually has an extension of either .tar.gz or .tgz)

In general, the following steps are used to install a tarball:

  1. For a GZipped tarball: tar –zxvf filename.tar.gz (or filename.tgz)
  2. For a BZipped tarball: tar jzvf (or filename.tbz)
  3. ./configure
  4. make
  5. (as root) make install

The configure stage is where your system is queried to see if it has all the dependent files. The make stage is where the executable is actually compiled, and the make install stage is when the completed application is installed onto your system. Generally if you make it past the configure then you’re probably going to be OK.

Use Arrow Keys (← →) to Browse

Be Sociable, Share!

Related Posts

  • Pingback: New Linux User » HOWTO: Monitor System Performance with Superkaramba.

  • Pingback: New Linux User » HOWTO: Use dpkg to Install .deb Files.

  • Pingback: New Linux User » The Free World: Checkinstall - The Source Installer’s Saviour.

  • bernie

    Files with the .tar.bz2 extension will need
    bunzip2 before tar (bunzip2 filename). This decompresses the file and truncates the name (don’t use the -z option in tar). Hopefully the bunzip2 fuction will find its way into tar some day and save our hard-working fingers.

  • Jon

    Hey Bernie,

    Thanks for the pointer. I’ve always done the bz2 files in two staged: ‘unbunzip’ it and then untar it. I didn’t know you could do it all in one step.


  • ahmed

    but there isn’t any thing about installing *.rpm package on debian based system,and the conversation method which is “align”.

  • Jon

    Hey Ahmed,

    Well, you’re not really supposed to install an *.rpm package on a Debian system. RPMs are made for Red Hat systems. There is a way to do it using alien which I cover here, but I’m not familiar with the “align” command.

  • emm

    Could anyone please give me a step by step instruction in installing *.deb files? i’ve downloaded a kvirc .deb file and i dont know what’s the command to install the file…

  • Jon
  • Andy

    i need help on how to instal wine for Mandriva its rpm i think

    ps:ty for any help

  • gaixixon

    I did the same to install a Debian package. after typing apt-get install opera.deb it says: reading package list..done
    building dependency tree..done
    E; Coundn’t find package Opera.deb (although Opera.deb still in the root folder!!??!!)

  • Jon

    HI Gaixixon,

    If you already have the *.deb file, then you want to use dpkg to install it. Go to the folder that Opera.deb is in and try:

    dpkg -i ./Opera.deb

    There’s a link to more info on dpkg:

    Good luck!

  • future_boy

    Hmm, i don’t seem to be able to get the ./configure command to work when trying to install from a tarball… (trying to install the free FPS Cube) I’ve already extracted it to /hom/joe/cube

    joe@linuxb0x:~$ cd /home/joe/cube/
    joe@linuxb0x:~/cube$ ./configure
    bash: ./configure: No such file or directory

  • Jon

    Hey future_boy.

    The configure/make/make install thing works for most packages, but the reality is that not all packages have a configure script. It sounds like your tarball doesn’t come with a configure script (as demonstrated by the ‘No such file or directory’ statement).

    You may be able to just to a make/make install. Is there a README or INSTALL file in the directory? That might shed some light on the correct steps to take for that particular tarball.

    Hope that helps!


  • Jacob

    do you think i may be able to do apt-get install ndiswrapper ? that would be awesome, because i am thinking of swiching back to ubuntu (currently on windows [don't kill me, i couldn't install any wg311 drivers]). If anyone knows if that would work or can tell me a command that would that would be awesome. btw, WG311 barly works on Windows, it freezes up after some random amount of time…

  • Jon

    Hey Jacob

    I’m running Kubuntu 5.10 and I only see the ndiswrapper source and utils, not the actualy plain old ndiswrapper package.

    That seems odd to me. Maybe take a trundle by the Ubuntu forums and check out what people over there are saying about ndiswrapper. It’s a hot topic so I think you’ll be able to get lots of help over there.

  • Marek

    Cool guide…
    but for me.. when i type (for nvu-ubuntu):
    apt-get nvu-1.0.ubuntu.5.04.deb
    it says E: invalid Operationg (package name)..

    Please Help!

  • Jon


    You’re using apt-get nvu-1.0.ubuntu.5.04.deb, but you need to use “install” as in:

    apt-get install nvu-1.0.ubuntu.5.04.deb

    Because you’re not typing ‘install’ apt thinks that ‘nvu-ubuntu’ is the apt-get operation, but it doesn’t recognize it.

  • Brian

    this is a poorly titled article.
    it says no where how to install .deb files, only how to use apt-get

  • dan

    apt-get install -force=yes Winamp_0.a1-1_i386.deb
    E: Could not open lock file /var/lib/dpkg/lock – open (13 Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

    me=beginner :D

  • George Bunyan

    dan : you need to run that command as root (the administrator) the simplest way to do this is prepend ‘sudo’ to your command so you would run ‘sudo apt-get install -force=yes Winamp_0.a1-1_i386.deb’.

    Alternatively you can use the su command to login as root so long as you know the root password. This can be done with ‘su -’.

  • dan

    Thank you!

  • george jacob

    could not open lock file /var/lib/dpkg/lock – open(2 no such file or directory).this is the error message am getting.Do u know y is it so?

  • Mike


    That was what I wanted to know!

    I am so confused!

  • mtkh


  • c.los

    Good article but it seems google finds this link when you search for “install deb” which isn’t helping other people much.

    Quick Ref:
    if you’ve already downloaded the deb file and have it on your hard drive run this…
    #: sudo dpkg -i /path/to/deb/file.deb

    if you’re installing something in the ubuntu repositories (check for whats available) – dont know much about debian itself.. do the following..
    #: sudo apt-get install packagename

    need help?
    #: apt-get help
    #: dpkg –help

    I’m a newbie also, just a little help because this was something I was learning not too long ago.

  • optionsss

    I have a quick question:

    apt-get install g_77…

    it says E: invalid can’t build the tree…

    and dpkg have dependency issues

  • chirag

    I am typing
    sudo apt-get install ubuntu-server-desktop
    I get error
    E: Could not open lock file /var/lib/dpkg/lock -open (2 No such file or directory)
    E: Unable to lock the administration directory (/var/lib/dpkg), are you root?

    I have installed a Vitual PC of Ubuntu Server on win-xp for testing and am trying to install Desktop capabilites on the Ubuntu Server.

    I am very new to Linux this is my first attempt..

  • robert

    hi all.

  • Marilyn

    Great tutorial.t

  • manny


    “sudo” is the command to do things as the system administrator, so it should ask for your admin (root) password.

    If you are going to install anything i suggest you open “Synaptic package manager” found in the “administration” menu. Just search for the package or software you want to install. I this case you were trying to install “ubuntu-server-desktop” so search for it in sypnatic.

    If it’s not there then google for instructions to add it to sypnatics (if that software exists of course as i was searching for it so i don’t think this one exists). Try searching for an alternative or a guide for server edition. Ubuntu forums is a good place to ask.

  • sahdev chand

    hello !
    i am facing the following problem while trying to install office org on RHEL 4
    [root@sahdev tmp]# tar -zxvf OOo_2.2.1_LinuxIntel_install_en-US.tar.gz
    tar: OOo_2.2.1_LinuxIntel_install_en-US.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors

  • Hilary

    Holy Mackerel, clear and understandable and apparently complete instructions! This is a first!!

    I’ve been trying to figure this stuff out for a long time–thank you, Jon, one whole heck of a lot!


  • http://- lex

    , … how to configr. -madwifi- ?

  • yogesh

    help to download and install wine on RHEL4.0

  • Anish Ganguly

    I don’t know how to install *.deb packages on Ubuntu.Please notify me at my e-mail id about the installation process and commands.

  • Jess

    Brilliant! Goodness, I can actually understand this!

    Thank you!

  • satya

    how to install MS OFFICE2003 IN REDHAT 5????

  • Pingback: Adware articles » Blog Archive » Wajig

  • http://none Wilfredo

    Really Good Reading….

  • tsolox

    you are ALL pitiful to read… Portage is the way.

  • Jon

    Spoken like a true Gentoo elitist. Why would a Gentoo user even be on a New Linux User site? Did Gentoo beat you up and steal your lunch money?

  • Clair

    @tsolox I don’t think everyone’s too pitiful. Others would disagree with you for certain reasons. Maybe you could have said WHY.
    @Jon Chill.

  • Jon

    It’s not a matter of whether or not portage is better. It’s the fact that portage is specifically the Gentoo package manager. He’s not saying that Debian or RPM users should use Portage as that is not possible. He is saying that everyone should use Gentoo. And that is just plain old elitist crap.

  • Anand

    How can i install .deb package in fedora 9

  • Pingback: Just Another Blog » Blog Archive » Lidt om pakker, download og install

  • ankit

    HI.. Experts..
    I am facing problem with my RHEL5.0. i installed it in my DELL A-840 but the drivers are not installed. i made yum server and installed GNOME,KDA. i removed Xorg.conf and restart the services of display. but still my graphics are not coming. my lan card is nt wrking.
    i am having drivers but its asking lots of dependency. and many files are having .deb extention.
    Pls do something and send me a solution i am very much tired.
    Thnx friends..


    hwo can i install deb file pls reply soon

  • Dutch

    Wow, type in all these cryptic commands and magic happens.

    how does one find out what the hell all these commands are, is there some sort of dictionary?

    This is really frustrating for someone who just wants to install applications so he can get to work on this “wonderful” operating system. The level of frustration involved in simply getting applications into place is phenomenal.

    Until Linux gets past this stage and into “1 click install” territory it is destined to remain a fringe OS. Great playground for geeks and developers to tinker with but a nightmare for people who “just want to get to work”.

  • Rinez Thapa

    if anyone could help me giving any information; How to install the file having .deb extension? I want to install virtual box in my OS. I am using vista. The file i downloaded has .deb extension but i could not proceed it anyway. .rar extension file is installed by winrar program. .deb extension file is installed by —————– ???????????????? reply to my mail as soon as possible!!! it would be a great help.

  • Clair Ching

    For those who want to install .deb files and are using Ubuntu 8.10, you could click on the .deb file and it will be installed for you. :) Otherwise go to the terminal and use the dpkg command. How does it work? It’s easy if you’re already on the path of the file. If you downloaded your .deb file in /home/username then on the command line make sure that you are there. The command to check where you are is pwd. The run the command “dpkg -i filename.deb” :) Remove the “” when you run the command.

    There are graphical interfaces for installing and stuff. :) But it doesn’t hurt to teach others how to use these commands either.

  • Pingback: Install Paket2 .deb .rpm .tgz .tbz…. « Ngeblog Dulu Ah

  • Pingback: Revisiting Some Linux Basics: Installing Applications : New Linux User - Linux Tips - Information for Using Linux

Be Sociable, Share!