b5media.com

Advertise with us

Enjoying this blog? Check out the rest of the Technology Channel Subscribe to this Feed

New Linux User

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

by Jon on September 30th, 2005

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.

POSTED IN: General

39 opinions for HOWTO: Install *.deb *.rpm and Source Code Files.

  • New Linux User » HOWTO: Monitor System Performance with Superkaramba.
    Nov 26, 2005 at 10:05 am

    […] Download the source code tarball from the Superkaramba site. For help on compiling and installing a program from source, click here. […]

  • 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. 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. […]

  • New Linux User » The Free World: Checkinstall - The Source Installer’s Saviour.
    Dec 26, 2005 at 10:04 am

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

  • bernie
    Jan 17, 2006 at 4:05 pm

    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
    Jan 17, 2006 at 5:37 pm

    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!

  • ahmed
    Feb 7, 2006 at 2:15 am

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

  • Jon
    Feb 7, 2006 at 9:33 am

    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
    Mar 3, 2006 at 10:50 am

    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
    Mar 3, 2006 at 11:00 am

    http://www.newlinuxuser.com/howto-use-dpkg-to-install-deb-files/

  • Andy
    Apr 2, 2006 at 6:55 am

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

    ps:ty for any help

  • gaixixon
    Apr 7, 2006 at 7:10 pm

    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
    Apr 7, 2006 at 7:21 pm

    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!

  • future_boy
    Apr 17, 2006 at 10:43 am

    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$

  • Jon
    Apr 17, 2006 at 7:36 pm

    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

  • Jacob
    Apr 27, 2006 at 7:40 pm

    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
    Apr 28, 2006 at 5:02 am

    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
    May 15, 2006 at 10:34 pm

    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
    May 16, 2006 at 4:27 am

    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.

  • Brian
    Oct 8, 2006 at 5:23 pm

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

  • dan
    Oct 25, 2006 at 3:25 am

    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
    Oct 25, 2006 at 5:22 am

    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
    Oct 27, 2006 at 1:44 am

    Thank you!

  • george jacob
    Jan 24, 2007 at 4:59 am

    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
    Mar 9, 2007 at 3:15 am

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

    That was what I wanted to know!

    I am so confused!

  • mtkh
    Mar 31, 2007 at 4:58 pm

    [@/home/web/it

  • c.los
    May 21, 2007 at 6:13 pm

    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.

  • optionsss
    May 24, 2007 at 1:33 pm

    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
    Jun 8, 2007 at 2:23 am

    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
    Jun 14, 2007 at 10:28 am

    hi all.

  • Marilyn
    Jun 16, 2007 at 4:01 pm

    Great tutorial.t

  • manny
    Jun 20, 2007 at 9:26 am

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

  • sahdev chand
    Jul 9, 2007 at 9:10 pm

    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
    Aug 6, 2007 at 2:30 pm

    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

  • lex
    Aug 29, 2007 at 4:51 am

    , … how to configr. -madwifi- ?

  • yogesh
    Dec 10, 2007 at 1:58 am

    help to download and install wine on RHEL4.0

  • Anish Ganguly
    Dec 26, 2007 at 3:00 am

    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
    Apr 7, 2008 at 4:30 pm

    Brilliant! Goodness, I can actually understand this!

    Thank you!

  • satya
    Apr 14, 2008 at 9:49 pm

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

  • Adware articles » Blog Archive » Wajig
    May 16, 2008 at 6:24 pm

    […] 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 […]

Have an opinion? Leave a comment:




Check Spelling
Activate Spell Check while Typing
Site Meter
Close
E-mail It