3

I am new to Linux and using Ubuntu. While I have learned the apt-get command but that just directly downloads and installs from the repositories.

I now want to install a piece of software that I have downloaded. It is a rar extractor (I tried searching on google but can't find a clear answer), the extension is .rpm and I put it in a folder named downloads on my Desktop.

Can anyone help me on how to compile or install it using the terminal/bash?

  • 1
    What software is it? RPM is not an Ubuntu format, you can probably find the software for Ubuntu. Why do you say it's a "rar extractor"? Please edit your question and add these details. – terdon Mar 24 '15 at 10:12
  • It seems that unless Ubuntu doesn't support .rpm packages can this question have no answer already on this site. – codezombie Mar 24 '15 at 13:25
  • 7
    You are trying to solve the problem "I need a RAR extractor for Ubuntu", and in trying to solve the problem, you have found a RAR extractor for some other Linux distribution, in the foreign RPM format. If you go to the Ubuntu Software Center and search for "RAR", the top hit will be Ubuntu's version of RAR, and all you have to do to install it is to click "Install". You will also find results when searching for "unrar" and "7zip". Try to get out of the habit of searching third-party sites for Ubuntu software, always try Ubuntu's own software center first. – Stuart Caie Mar 24 '15 at 14:30
  • If you would like to unrar something on ubuntu check out askubuntu.com/questions/41791/… – Beau Bouchard Mar 24 '15 at 19:31
7

RPM is a package for Red Hat based Linux distributions. RPM means Red Hat Package Manager. Ubuntu uses a package system called apt from Debian. Those packages have a .deb ending. I'm sure the package you want, is also available in that format. After downloading a deb file you can install it manually with this command:

dpkg -i package.deb

Technically, it is also possible to install an rpm package on another distribution, but I don't recommend that. It brings chaos and disorder.

  • 1
    Indeed. The best way is to locale a package made for your distribution, either from official repositories (preferred), third-party repositories (good enough) or single package files (not that good). – Daniel B Mar 24 '15 at 10:15
  • 1
    I still think it's worth putting down how to install RPMs on Ubuntu, with a qualification that "only do this if you really need to", etc. I've been handed RPMs at work before, with no other alternative. – Chaosed0 Mar 24 '15 at 12:55
7

By using alien. All LSB compliant distributions must be able to handle RPM-packages and for Debian derived systems, that means using alien.

Generally an RPM-package should install cleanly on any distribution (if not, complain to the packager) which is LSB compliant. I don't believe Ubuntu is LSB compliant; not with a default installation at least -- most distributions are not LSB compliant with a default installation but usually have some *-lsb package which will fix the issue.

unrarwill allow you to extract rar-achives (if that's what you need) and is available for Ubuntu in a repository; please look into installing using standard means instead.

  • do you mean the software OP talks about is installable on Ubuntu? – codezombie Mar 24 '15 at 13:23
  • 1
    Maybe. That depends on what he's looking for. It appears to me that he want's unrar, but I can't be sure. Also, I don't use Ubuntu so I'm not sure if Ubuntu has unrar in default repositories, but I'm quite sure there's a third-party repository if Ubuntu doesn't have it. I would be very surprised to learn that Ubuntu doesn't have it in the default repositories: Canonical doesn't seem to be frightened to include non-free software as part of the default installation or repositories and a lot of people like unrar. – Clearer Mar 24 '15 at 13:26
  • 1
6

There is more than one way to install software on Linux:

  1. Repositories

    • Debian based distributions (Debian /Ubuntu/Mint) use apt-get to download and install from repositories.
    • RedHat (RedHat /Fedora/Centos) based distributions use yum to download and install from repositories.

    Pros: The software on the official repositories has been extensible tested for stability and for malware/spyware features. All the dependencies (libraries, additional packages,etc.) needed are automatically installed. Extremely easy upgrade of software packages. You can add additional sources (repositories) to have a wider choice of software.

    Cons: Sometimes the package you're looking for isn't in the official repositories or there is an older version. Additional repositories installed from unknown or non-trusted sources can put your system on risk.

  2. Pre-compiled packages

    • Debian based distributions (Debian /Ubuntu/Mint) use .deb files.
    • RedHat (RedHat /Fedora/Centos) based distributions use .rpm files.

    Pros: Easy install of software not included on repositories.

    Cons: You have to be more careful about packages not intended for your distrbution and version. There is a slight chance of installing malware when you use packages from unknown and non-trusted sources. No easy upgrades.

  3. Compile source code

    • Usually are .zip and tar.gz compressed files.

    Pros: Install software when there is no package for your Linux distribution. If you are a developer you can modify the source code to make the software more suitable to your needs.

    Cons: Compiling source code could be difficult and cumbersome. You will have to manually install all the dependencies. If you're not careful you can break your system. Nothing guarantees that you're not installing malware or spyware. Upgrades means compiling again.

3

It sounds like @user430190 already has a .rpm file and wants to convert it into a .deb / other file format to install it on Ubuntu. For example: I ran into something similar as many printer drivers may not have duplicate formats for "all" distributions. If this is the case I have been successful using Alien.

sudo apt-get install alien

then try

sudo alien -d -i <package_name>.rpm

-d, --to-deb Make debian packages. This is the default.

-i, --install Automatically install each generated package, and remove the package file after it has been installed. (remove this if you want to just have the package sitting there after run)

this converts the .rpm to a .deb file. You should really be looking for an alternative way to install your package first, as this can not work part of the time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.