1

I tried to install gcc compiler because I want to learn programming I have an old computer 1gb ram so I installed an older version of Ubuntu (10.04) and its working faster than before but when I try to install gcc package by writing

sudo apt-get install gcc 

but the following text appear :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gcc

so I said maybe the problem is that my version of ubuntu is too old so I wrote in the terminal

sudo get-apt upgrade 

but this also appear to me

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

and I tried also

sudo apt-get update 

but many lines appear and the last one was

E: Some index files failed to download, they have been ignored, or old ones used   instead 

and I noticed also that this version of Ubuntu don't have a graphical package manager so .

3 Answers3

1

Desktop version of 10.04 end the life so you can't install gcc using apt-get...

You should upgrade to latest version of Ubuntu.

To upgrade latest you can do with sed, first open terminal(Ctrl+Alt+T) and type the following,

sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

then update with

sudo apt-get update && sudo apt-get dist-upgrade
Kaz Wolfe
  • 34,680
A J
  • 11,557
0

I would definitely not recommend installing older Ubuntu versions, given that there will be no security updates for them, leaving your system vulnerable for all kinds of attacks. Instead, it would be better to go for a lighter desktop edition, for example LUbuntu (or are you already using that give nthat this post is tagged with lubuntu).

As to the missing gcc and the failing index files: maybe the Ubuntu mirror that you selected during installation no longer contains the files for older releases like Ubuntu 10.04. You can check the mirror that you are using in the file /etc/apt/sources.list. For example mine shows several references to the Dutch mirror: http://nl.archive.ubuntu.com.

ph0t0nix
  • 1,397
0

Which version of gcc do you want to install? All gcc release are in here just download what version of gcc if you want from there and then install by your self. If you don't know how to install that, follow this question is answered here.

αғsнιη
  • 36,350