How to install rar (no installation candidate)?

42,916

Solution 1

Install with the following commands,

sudo apt-get install unrar-free

Solution 2

rar is provided in the multiverse component, so you must enable that repository. To do this, open up the Software Sources window in any of three ways:

  • Press Alt+F2 and run software-properties-gtk. (Use software-properties-kde instead if this is a Kubuntu system.)
  • Open the Software Updater (or Update Manager, in older releases) and click Settings... at the lower-left corner of the window.
  • Open the Software Center and go to Edit > Software Sources....

Software Sources window showing Ubuntu Software tab with mouse pointer hovering over checkbox label for multiverse repository component

In the Ubuntu Software tab of the Software Sources window, under **Downloadable from the Internet*, one of the checkboxes is:

  • Software restricted by copyright or legal issues (multiverse)

Check that box. You may be prompted for your password, to make the change. After you've done so and the box has a check in it, click Close to close the Software Sources window. Now try installing again.

(If it still doesn't work and you're installing from the Terminal with apt-get, try running apt-get update then attempting the installation again.)

How to find software with "no installation candidate"?

To find out why you might not have been able to install rar, the first thing I did was to go to packages.ubuntu.com and search for it.

Searching for the rar package, in all currently supported releases.
Searching for rar in all supported releases (can also search one specific release).

The results revealed it to be in the multiverse component.

Search results for rar (searching in all non-EoL releases).

Solution 3

Package rar exists in multiverse: http://packages.ubuntu.com/quantal/rar

Multiverse is a non-free repositorie so... make sure you enable it/have it enabled.

apt-cache policy rar tells you where to find it:

$ apt-cache policy rar
rar:
  Installed: (none)
  Candidate: 1:3.7.1-1
  Version table:
     1:3.7.1-1 0
        500 http://nl.archive.ubuntu.com hardy/multiverse Packages
Share:
42,916

Related videos on Youtube

Alex
Author by

Alex

Updated on September 18, 2022

Comments

  • Alex
    Alex almost 2 years

    I need the package rar. But I get this error whenever I try to install it:

    Reading package Lists... Done
    Building dependency tree
    Reading state information... Done
    Package rar ist not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or is only available form another source
    E: package 'rar' has no installation candidate.
    

    What must I do to get rar?

    • Ander2
      Ander2 over 11 years
      Have you tried an apt-cache search rar and see the results?
  • Rinzwind
    Rinzwind over 11 years
    add in the apt-cache policy rar and I can remove my answer ;)
  • Eliah Kagan
    Eliah Kagan over 11 years
    @Rinzwind I think your answer is also good; in my opinion, they should both exist. (I was going to upvote it, when I get more votes.) Anyway, it's your call. Feel free to edit that into my answer if you like. (If nothing happens for a while I'll probably edit it to include at least a mention of that command.)
  • Eliah Kagan
    Eliah Kagan over 11 years
    apt-cache policy packagename reports the software sources that are already configured to provide the package. Can it be used to tell someone where to find a package that it's provided by any currently enabled repository?
  • Ron
    Ron about 8 years
  • peiman F.
    peiman F. almost 7 years
    nice..worked on ubuntu 16.04