How does the following installation are differ from one another?
1
2
3
$sudo add-apt-repository ppa:maco.m/ruby
$sudo apt-get update
$sudo apt-get install rubygems
Line1 : adds PPA to your list of sources
Line2 :Tells apt-get to get update its database
Line3 :finds the updated package from the database and installs it.
1
$sudo apt-get install rubygems
It will just install the less recent version of the specific package.
What is PPA?
PPA - Personal Package Archives
These are generally used by the people who want latest and greatest. Also it involves some danger(You should definitely know what you are doing). Ubuntu distro usually released at every 6 months. Hence if you want some update before their release you can use PPA for that.
You can add PPA to your machine using 2 Methods:
1.GUI - Ubunutu supports this feature (There are many articles out there please refer those)
2.Command line - Refer the question
If you want to remove the PPA, then just removing the specific repository from the source.list
file is not enough. It would be better to remove all the package which are installed along with that installation of PPA and then replace with the default package.
1
$sudo ppa-purge ppa:<lp-name>/<ppa-name>