Ubuntu 11.04: `apt-get install rake` -> “E: Unable

2019-07-19 07:16发布

问题:

This is probably a type of "is it plugged in?" question, but after getting a default Rackspace image of Ubuntu 11.04 up. Running command (as root)

apt-get install rake

Fails with error

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rake

I'm missing something simple I'm sure.

回答1:

It appears that rake package is not in the 11.04 sources, but it is in 10.10 sources.

To get apt-get install rake to work on 11.04:

Add the following lines to /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ maverick main restricted universe

deb-src http://archive.ubuntu.com/ubuntu/ maverick main restricted universe

Update package listing

apt-get update

Now rake should be available:

apt-get install rake



回答2:

Try gem install rake

It may be better to use rvm than Ubuntu's Ruby and Gem.