# Installing gcc on Ubuntu: works on Dapper Drake, i.e. 6.0.6 LTS



## lotuseclat79 (Sep 12, 2003)

Gcc is not usually installed on Ubuntu by default, so if you don't have it, here is how to get it. Of course, if they are now including it, you already have it.

First issue the command to become superuser:

$ sudo -i
# cd /etc/apt
# cp source.list sources.list.orig
# vi sources.list
<uncomment the following two statements. Note: to do this you need to use the internal vi editing keys: 'i' for input; 'o' for new input line; ESC to close editing; and the 'j',k','l', and 'h' keys to navigate lines - down, up, right, left; and :wq to write and then quit; :q! to quit without writing>
Here is the original form of the following two statements:
# deb http://archive.ubuntu.com/ubuntu dapper universe
# deb-src http://archive.ubuntu.com/ubuntu dapper universe
and here is the form after the edits:
deb http://archive.ubuntu.com/ubuntu dapper universe
deb-src http://archive.ubuntu.com/ubuntu dapper universe
:wq <to quit out of the vi edit session>
# exit <exit the superuser account, and become the ubuntu user>

From the ubuntu user account, issue the followning commands:
$ sudo aptitude update
$ sudo aptitude install build-essential

This will also probably work on later editions of Ubuntu.

-- Tom

P.S. To uncomment the two statements it is probably easier to just use the 'j' key to position the cursor onto the '#' of each statement, and then hit the 'x' key to erase the '#' and again to erase the following space.


----------

