APT in Ubuntu Tutorial

26 02 2010

This is a tutorial for the NosillaCast on how to use APT (Advanced Packaging Tool) from the command line in Ubuntu Linux.

To add a PPA in Ubuntu 9.10 Karmic Koala:

1.) Open a Terminal
2.) Type: “sudo add-apt-repository Insert-PPA-Here”, replacing “Insert-PPA-Here” with the URL of the PPA. (EG. ppa:ppa/section)

To add any other repository:

1.) Open a Terminal,

2.) Type: “sudo gedit /etc/apt/sources.list”

3.) Paste the APT line of the repo at the end of the document. (EG. deb http://download.virtualbox.org/virtualbox/debian karmic non-free)

4.) Save and quit

My new APT line is highlighted.

If it requires a key, add the one provided on the site (usually it doesn’t)

1.) Open a Terminal

2.) Get the key from the site. (EG. wget http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc)

3.) Add it with: “sudo apt-key add Key-Path”, replacing “Key-Path” with the path to the key. (EG. sun_vbox.asc)

Adding the key

To install a package:

1.) Open a Terminal

2.) Update the package listing: “sudo apt-get update”

The command only. The results can be seen in the next image.

2.) Type: “sudo apt-get install Package-Name”, replacing “Package-Name” with the name of the package. (EG. virtualbox-3.1)

3.) Tell it “Yes!”

4.) Wait, have a cup of coffee

5.) Run your app!

Installing VirtualBox