3

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
  • 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 05 '12 at 14:32
  • Hi, Yes I can ping 8.8.8.8 so think the network bit is ok. – Dave Daniels Sep 05 '12 at 14:49
  • Here is the sources list # See http://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

    – Dave Daniels Sep 05 '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 05 '12 at 15:00
  • /etc/apt$ http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release -bash: http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release: No such file or directory – Dave Daniels Sep 05 '12 at 15:00
  • Oops, I accidentally a word, please run wget http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release – pgschk Sep 05 '12 at 15:04
  • thanks pgschk, I'll try to do an update so you can see the response as it should be – Dave Daniels Sep 05 '12 at 15:04
  • think you have found the problem, the output from the wget is :/etc/apt$ wget http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release --2012-09-05 16:05:12-- http://gb.archive.ubuntu.com/ubuntu/dists/precise/Release Connecting to 10.40.0.44:80... connected. Proxy request sent, awaiting response... 407 Proxy Authentication Required 2012-09-05 16:05:12 ERROR 407: Proxy Authentication Required. – Dave Daniels Sep 05 '12 at 15:08
  • Then you should have a look at this post: http://askubuntu.com/q/23666/78830 – pgschk Sep 05 '12 at 15:11
  • I have now added the commands to get through the proxy but it still doesn't let me through. I have added the proxy to apt.conf and also .profile and bash.bashrc for good measure. I know the usernames and passwords are correct otherwise I wouldn't be able to type on here. is there anywhere else I need to put the proxy server settings into? – Dave Daniels Sep 05 '12 at 15:39

1 Answers1

0

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

Hope this helps! :)

Erro
  • 879