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




4 responses

28 02 2010

wow. um. this sounds pretty hard actually. what about double clicking something? I know I sound silly here, but I’m actually serious…

28 02 2010
Matt Rhinesmith

In what sense? This tutorial is for the command line, which is actually faster and easier. To do it graphically, you can use Synaptic by selecting Settings>Repositories>Add and pasting/typing the APT line. However, PPAs still need the key, and a whole mess of copy-pasting is required to do that. That’s why I recommend using add-apt-repository to add PPAs and Synaptic or gedit to add the rest. Also, be grateful I used gedit in the tutorial. I could have said “sudo nano /etc/apt/sources.list” but I’m not that diabolical. If you want to know why, type “nano newdoc” in a Terminal and feel the pain. I promise it won’t mess anything up, just show how horrid command-line text editors are.

7 03 2010
#249 Awesome Bar, Ubuntu Packages, Kupfer, Logitech Lap Desk, CarMD, Faking Motion Blur « Nosillacast

[…] resistance is futile hasn’t met me, because even with the great instructions on his blog at binaryclock.wordpress.com I managed to not achieve the […]

28 03 2010

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: