How can I install from an rpm file on ubuntu?

10,739

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.

Share:
10,739

Related videos on Youtube

user430190
Author by

user430190

Updated on September 18, 2022

Comments

  • user430190
    user430190 over 1 year

    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?

    • terdon
      terdon about 9 years
      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.
    • Mehdi Haghgoo
      Mehdi Haghgoo about 9 years
      It seems that unless Ubuntu doesn't support .rpm packages can this question have no answer already on this site.
    • Stuart Caie
      Stuart Caie about 9 years
      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.
    • Beau Bouchard
      Beau Bouchard about 9 years
      If you would like to unrar something on ubuntu check out askubuntu.com/questions/41791/…
  • Daniel B
    Daniel B about 9 years
    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).
  • Mehdi Haghgoo
    Mehdi Haghgoo about 9 years
    do you mean the software OP talks about is installable on Ubuntu?
  • Clearer
    Clearer about 9 years
    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.
  • Beau Bouchard
    Beau Bouchard about 9 years