2

Got this error message:

[sudo] password for saeedeh: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ruby

What should I do?

  • 1
    Check your repository settings - Ruby is packaged as ruby. What Ubuntu version do you have? – N0rbert Jan 24 '18 at 16:20
  • "Unable to locate" a package that is in the Ubuntu repos (like ruby) means that your apt data base is either empty or corrupt. Run sudo apt update to populate the apt database, then try installing ruby again. – user535733 Jan 24 '18 at 17:54
  • First thing is to make sure that you are using one of the currently supported releases – steeldriver Jan 24 '18 at 18:19
  • my ubuntu version 17.04 – saeedeh Jan 25 '18 at 8:20
5

As @N0rbert said, It probably depends on version of Ubuntu you're working on. You could test sudo apt-get update and then run sudo apt-get install ruby-full again.

If above mentioned method fails, you must try other methods. Ruby official site states:

There are several ways to install Ruby:

When you are on a UNIX-like operating system, using your system’s package manager is the easiest way of getting started. However, the packaged Ruby version usually is not the newest one.

Installers can be used to install a specific or multiple Ruby versions. There is also an installer for Windows.

Managers help you to switch between multiple Ruby installations on your system.

And finally, you can also build Ruby from source.

| improve this answer | |

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.