Tuesday, August 04, 2009

Updating a Linux box behind proxy server

Recently I had to update a Linux (Fedora 9 to be precise) box, which was behind a proxy server. To get through the proxy server I configured relevant environment variables as described here. After executing 'sudo yum update' command system seems to be hanged after emitting following line on the console-

Loaded plugins: refresh-packagekit

After a long wait yum failed with following error message on console-

[vinod@localhost ~]# sudo yum update
Loaded plugins: refresh-packagekit
Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-9&arch=i386 error was
[Errno 4] IOError: <urlopen error (110, 'Connection timed out')>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again


OK, so yum was not able to get through proxy, but when I tried to access the same URL using wget-

[vinod@localhost ~]# wget http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-9&arch=i386

it was able to access it. Then what could be wrong :-/

After pondering for sometime, I realized that proxy configuration was done using a non-root user while yum was running as root (due to sudo). Environment variables configured for a user are not carried forwarded (to another user) by Linux when user is changed using su or sudo command. Configuring the proxy as root solved the problem and yum successfully updated system.

1 Comment:

NRTaJa64mYWS said...

Despite being called Cosmic Slot, the on 온라인카지노 line casino provides all kinds of other games, however the “Cosmic” part is true, as the platform does use the universe as its theme. After partnering with a number of} software developers, Cosmic Slot amassed over 3,one hundred obtainable games. You can deposit money in AUD by using Visa, Mastercard, Neosurf, Mifinity, and Bitcoin, and play any of them at any time.