Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What does this mean?

sudo add-apt-repository ppa:maco.m/ruby
sudo apt-get update
sudo apt-get install rubygems

Hows does it differ from running

sudo apt-get install rubygems


share|improve this question
up vote 12 down vote accepted

There are three steps to what you're running:

1) add-apt-repository adds a PPA to your list of sources, so that Ubuntu knows to look for updates from that PPA as well as from the official Ubuntu sources. Usually this is used to allow developers to provide updates more quickly than those in the official Ubuntu repositories.

2) apt-get update tells apt-get to update its database of what packages can be installed and where to install them from. In this case, apt-get will see your newly-added PPA and discover that ppa:maco.m/ruby has the newest version of rubygems that it knows about, so it will make a note to install rubygems from the PPA next time someone asks to install it.

3) apt-get install causes apt-get to find the package in its database and download and install the indicated file. In this case, it will find the rubygems package, download it from ppa:maco.m/ruby, and install it.

If you were to simply run apt-get install rubygems, you would get a less-recent version (or perhaps nothing at all, depending on whether rubygems is also in the Ubuntu repositories or only in the PPA).

In general, the format ppa:a/b will expand to, where you can view the files and download them individually. In your case, that would be

share|improve this answer
add-apt-repository also imports the GPG public key of the PPA automatically, which is very convenient. – Jorge Castro Jan 9 '11 at 4:36
And remeber this command is ubuntu specific and wont work in debian. – tinhed Jan 9 '11 at 4:50

Repository is a place where multiple databases are provided .

apt :- A Debian tool used to manage packages. When a user installs a package on a system, it also searches for and then installs or upgrades all the necessary dependent packages to make the package work. The actual command is apt-get.

share|improve this answer

The Repository mean depot or place for it, and it there in the source.list file, and the add means it add the software apt (aplication), and it when you update it get the files from the www url, and apt whit get whit update means the it update it in the system buffer, and that it for install the rugbygems when you use apt-get install, and you can also after type in this in the terminal:

sudo apt-get upgrade

and it should mean that its upgrade the software, and then enter this in the terminal:

sudo apt-get dist-upgrade

and this should mean an distribution upgrade, and that is also of the software. You can also reconfigure the software, and you should then enter this in the terminal:

sudo dpkg-reconfigure rugbygems

and that is its if the conf file does not work, and that is if runs whit an error.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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