LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Apt-get: Network is unreachable (https://www.linuxquestions.org/questions/linux-networking-3/apt-get-network-is-unreachable-4175501774/)

just-a-guest 04-15-2014 03:12 AM

Apt-get: Network is unreachable
 
I am on a Kubuntu behind a proxy and I'm trying to make sudo apt-get update. The apt-get says
Quote:

Cannot initiate the connection to ru.archive.ubuntu.com:80 (2a02:6b8::183). - connect (101: Network is unreachable) [IP: 2a02:6b8::183 80]
The problem is that this error is really weird, because:
1) I configured proxy in system settings.
2) I suppose, that apt-get can't handle this settings, so I tried to configure proxy for an apt-get through an export as follows:
Quote:

export http_proxy=10.5.57.177:3128
export https_proxy=10.5.57.177:3128
export ftp_proxy=10.5.57.177:3128
And when it doesn't worked, I tried this:
Quote:

export http_proxy=http://10.5.57.177:3128
export https_proxy=https://10.5.57.177:3128
export ftp_proxy=ftp://10.5.57.177:3128
But nothing get worked :(

just-a-guest 04-15-2014 04:33 AM

Hmm, I found a strange thing: the apt-get works through a netbook with an installed Ubuntu. So I tried to copy sources.list(though it's pretty the same, the only difference is the release name: precise VS saucy), but it doesn't worked anyway.
I hope I'm close... «The Truth Is Out There» =)

just-a-guest 04-15-2014 06:41 AM

Aha! Through comparing tcpdump output on a netbook and PC, I found a next hint: all output of the netbook goes through a 3128 port -- it's a proxy. On a desktop that's also true for webpages, but not for an apt-get.
This also means that export http_proxy= doesn't work, although it should, so an apt-get is buggy.
Anyway, despite the broken apt-get there's sure a way to get it work, as apt-get on a netbook working without dark magic with an "export".

TobiSGD 04-15-2014 07:00 AM

apt-get has its own configuration file for proxy settings: http://www.debian-administration.org/articles/177

just-a-guest 04-15-2014 07:14 AM

Quote:

Originally Posted by TobiSGD (Post 5153026)
apt-get has its own configuration file for proxy settings: http://www.debian-administration.org/articles/177

This is true, but this is a permanent settings. They wrote in a manual that I can set a temporary proxy settings through an export and they're lying as you're can see =) I don't think that a permanent settings going to work, if a temporary doesn't.

just-a-guest 04-15-2014 07:57 AM

Finally I get it to work! Tell me, do anybody see which one of two lines below is going to guide me to the success?
Quote:

constantine@constantine-desktop:~$ echo $http_proxy

Quote:

constantine@constantine-desktop:~$ echo $http_proxy
http://10.5.57.177:3128
Yes, you're right, the second one is wrong. To be precicer it's just unnecessary line, it looks like a ghost: it was mentioned everywhere but doesn't seems that something depends on this line.
The solution was to add the line http_proxy="http://10.5.57.177:3128" to the /etc/environment/. When an apt-get launched it's parses this file and this line too.
This blog post very helped me, thank him very much!


All times are GMT -5. The time now is 03:57 PM.