Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
‘apt-get’ does not work with Proxy

Everything I try with apt-get fails. I am installing Ubuntu server for the first time. It is version 12.04 LTS. When I run:

apt-get update

I get failed to fetch http://gb.whatever goes here......

If I run

apt-get install install build-essential

I get "unable to locate package build-essential"

I have looked at the sources.list but do not know what should and shouldn't be in there.

This is the current content of sources.list:

# See help.ubuntu.com/community/UpgradeNotes for how to upgrade to 
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu precise main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu precise main restricted

## Major bug fix updates produced after the final release of the
## distribution. 
deb http://gb.archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu precise-updates main restricted
share|improve this question
1  
Are you positive you have network connection? Does ping 8.8.8.8 work? If yes, please post a bit of the file /etc/apt/sources.list –  pgschk Sep 5 '12 at 14:32
    
Hi, Yes I can ping 8.8.8.8 so think the network bit is ok. –  Dave Daniels Sep 5 '12 at 14:49
    
Here is the sources list # See help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb gb.archive.ubuntu.com/ubuntu precise main restricted deb-src gb.archive.ubuntu.com/ubuntu precise main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb gb.archive.ubuntu.com/ubuntu precise-updates main restricted deb-src gb.archive.ubuntu.com/ubuntu precise-updates main restricted –  Dave Daniels Sep 5 '12 at 14:53
1  
That works for me. Are you using a HTTP proxy? Could the problem be a firewall? Please try to download the Release file manually, post the output of http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release (Note: In order to have formatting, it is best if you update your original post with the output) –  pgschk Sep 5 '12 at 15:00
    
show 5 more comments

marked as duplicate by Jorge Castro, Eric Carvalho, Eliah Kagan, Ringtail, hhlp Jan 8 '13 at 9:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Try sudo apt-get install -f. This fixed my problem similar to yours. You can test it afterwards by updating.

Hope this helps! :)

share|improve this answer
add comment

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