You'll need to backup and edit /etc/apt/sources.list
sudo su -
cp /etc/apt/sources.list /etc/apt/sources.list.backup
gedit /etc/apt/sources.list
# comment out the cdrom: entries at the top by putting a # in front
# then scroll down and uncomment the ubuntu.com lines by removing the # from the beginning of the line
e.g.
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
Once you've done that save and exit then run
apt-get update
apt-get install gcc yadda yadda yadda
Or you can head on over to System Administration Update Manager click settings and mess with the settings there.
Good luck