Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a virgin debian 5 image on a VPS. To be honest, this may not be the brightest VPS provider in the world and I suspect their image isn't perfect.

apt-get fails for everything:

# apt-get -y install gcc
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package gcc

There is an /etc/apt/sources.list:

# cat /etc/apt/sources.list
deb lenny main contrib non-free
deb lenny/volatile main contrib non-free
deb lenny/updates main contrib non-free

...which I think is correct.

Now if I use apt-cache, I find it:

# apt-cache search gcc
libgcc1 - GCC support library
gcc-4.3-base - The GNU Compiler Collection (base package)

To be honest, I'm not the world's strongest Debian guy. Anyone care to speculate where I should start to fix this problem?

share|improve this question
Doesn't apt-get clean && apt-get update help? – HUB Apr 20 '11 at 17:08

Try 'apt-get -y install gcc-4.3-base'

EDIT: To add, unless I'm mistaken, the reason why is because the package is called gcc-4.3-base not just gcc.

share|improve this answer
Paul, that worked great. But something is still wrong. apt-cache search aptitude returns nothing. after apt-getting gcc-4.3-base, I still don't get gcc (ran find / and didn't find a 'gcc'). – raindog Apr 20 '11 at 17:25
You can use apt-cache search $package_name to search – Sameer Apr 20 '11 at 17:29
Dumb question... when was your last apt-get update? – Hyppy Apr 20 '11 at 18:11
Not a dumb question at all - that turned out to be the issue. My faith in this VPS vendor is dropping moment by moment...good thing it only cost me $15/year :-) Thanks for all the help. – raindog Apr 20 '11 at 21:04
to be fair the VPS provider has done nothing wrong. To get the latest package list you will always need to do an update, and the error you were suffering from was because you were typing in the wrong package name. – Ardesco Apr 28 '11 at 10:37

What about:

apt-get update
apt-get install build-essential
apt-get install gcc

The package build-essential for lenny (link) should keep you from chasing other missing packages (libs) if you're heading for building sources.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.