Skip to content

Thursday, November 26th, 2009

New Linux User

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

September 30, 2005 by Jon  
Filed under General

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 tar.bz 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 filename.tar.bz (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.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot
  • E-mail this story to a friend!

Comments

53 Responses to “HOWTO: Install *.deb *.rpm and Source Code Files.”
  1. bernie says:

    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.

  2. Jon says:

    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.

    Thanks!

  3. ahmed says:

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

  4. Jon says:

    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.

  5. emm says:

    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…

  6. Andy says:

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

    ps:ty for any help

  7. gaixixon says:

    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!!??!!)

  8. Jon says:

    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:http://www.newlinuxuser.com/howto-use-dpkg-to-install-deb-files/

    Good luck!

  9. future_boy says:

    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
    joe@linuxb0x:~/cube$

  10. Jon says:

    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!

    J

  11. Jacob says:

    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…

  12. Jon says:

    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.

  13. Marek says:

    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!

  14. Jon says:

    Marek,

    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.

  15. Brian says:

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

  16. dan says:

    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

  17. 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 -’.

  18. dan says:

    Thank you!

  19. george jacob says:

    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?

  20. Mike says:

    YOU NEVER SAID HOW TO ACTUALLY INSTALL THE *.DEB FILE!

    That was what I wanted to know!

    I am so confused!

  21. mtkh says:

    [@/home/web/it

  22. c.los says:

    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 http://packages.ubuntu.com for whats available) – dont know much about debian itself.. do the following..
    #: sudo apt-get install packagename

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

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

  23. optionsss says:

    I have a quick question:

    apt-get install g_77…

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

    and dpkg have dependency issues

  24. chirag says:

    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..

  25. Marilyn says:

    Great tutorial.t

  26. manny says:

    @chirag

    “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.

  27. sahdev chand says:

    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

  28. Hilary says:

    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!

    H

  29. lex says:

    , … how to configr. -madwifi- ?

  30. yogesh says:

    help to download and install wine on RHEL4.0

  31. 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.

  32. Jess says:

    Brilliant! Goodness, I can actually understand this!

    Thank you!

  33. satya says:

    how to install MS OFFICE2003 IN REDHAT 5????
    OR
    HOW TO INSTALL THE OPENOFFICE.ORG.EXE IN REDHAT5??
    PLEASE REPLY SOON.

  34. Wilfredo says:

    Really Good Reading….

  35. tsolox says:

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

  36. Jon says:

    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?

  37. Clair says:

    @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.

  38. Jon says:

    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.

  39. Anand says:

    How can i install .deb package in fedora 9

  40. ankit says:

    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..

  41. MUKESH PATIDAR says:

    hwo can i install deb file pls reply soon

  42. Dutch says:

    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”.

  43. Rinez Thapa says:

    Hello,
    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.

  44. Clair Ching says:

    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.

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

Trackbacks

Check out what others are saying about this post...
  1. [...] Download the source code tarball from the Superkaramba site. For help on compiling and installing a program from source, click here. [...]

  2. [...] 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. [...]

  3. [...] When speaking of installing applications on a GNU/Linux box, I frequently lament that installing from a source tarball using the configure/make/make install process is a double-edged sword. On one hand you generally get a nice compact binary that runs fast because it was compiled for your system. On the other hand, since it wasn’t a package, you lose the ability to remove it cleanly via your distro’s package management system. [...]

  4. [...] HOWTO: Install *.deb *.rpm and Source Code Files. New Linux User » HOWTO: Use dpkg to Install .deb Files. Nov 27, 2005 at 9:30 am. […] I’ve written about using apt-get to get and install debian packages. Tags: thoughts [...]

  5. [...] Paket2 .deb .rpm .tgz .tbz…. Untuk install paket2 sofwtare, merujuk dari sini, bisa [...]



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2009 b5media. All rights reserved.