Saturday 18 May 2013

Fedora: "[Errno 12] Timeout" problem with Yum

Today I encountered a problem while trying to check for updates with yum. It was quite a while ago that I last used the command line tool, as the super annoying PackageKit was constantly reminding me how lazy I am (though telling PackageKit not to be an old maid is extremely simple, but this is another story).
Anyhow, check-update wasn't working quite well:
 [lillo@pc-lillo ~]$ sudo yum check-update  
 [sudo] password for lillo:  
 Loaded plugins: langpacks, presto, refresh-packagekit  
 http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora17/repodata/repomd.xml: [Errno 12] Timeout on http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora17/repodata/repomd.xml: (28, 'connect() timed out!')  
 Trying other mirror.  
 http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')  
 Trying other mirror.  
 http://dl.google.com/linux/talkplugin/rpm/stable/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://dl.google.com/linux/talkplugin/rpm/stable/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')  
 Trying other mirror.  
 Could not retrieve mirrorlist http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-17&arch=x86_64 error was  
 12: Timeout on http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-17&arch=x86_64: (28, 'connect() timed out!')  
 http://ftp-stud.hs-esslingen.de/pub/Mirrors/rpmfusion.org/free/fedora/updates/17/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://ftp-stud.hs-esslingen.de/pub/Mirrors/rpmfusion.org/free/fedora/updates/17/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')  
 Trying other mirror.  
 http://fedora.uib.no/rpmfusion/free/fedora/updates/17/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://fedora.uib.no/rpmfusion/free/fedora/updates/17/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')  
 Trying other mirror.  
 ........  
I immediately thought there was a problem with the proxy configuration for yum: at work I use the company's proxy, so settings in /etc/yum.conf are required. I just commented out all the proxy-related stuff.
 [lillo@pc-lillo ~]$ sudo gedit /etc/yum.conf
[main]  
 cachedir=/var/cache/yum/$basearch/$releasever  
 keepcache=0  
 debuglevel=2  
 ........
 # PUT YOUR REPOS HERE OR IN separate files named file.repo  
 # in /etc/yum.repos.d  
 # The proxy server - proxy server:port number   
 # proxy=http://PROXY_ADDRESS:PROXY_PORT  
 # The account details for yum connections   
 # proxy_username=USERNAME   
 # proxy_password=PASSWORD 
At this point I checked again for updates, but things were still not working right. After some time spent on thinking about how mediocre I am, I thought of the environment variables.
 [lillo@pc-lillo ~]$ echo $http_proxy  
 http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT  
 [lillo@pc-lillo ~]$ echo $https_proxy  
 https://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT  
Damnit, the environment variables. I forgot that months ago I had put the $http_proxy and $https_proxy variables in the /etc/environment file. In my case I just had to comment-out the proxy-related lines:
 [lillo@pc-lillo ~]$ sudo gedit /etc/environment  
 ....  
 # http_proxy="http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT"  
 # https_proxy="https://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT"  
 ....  
If yours is not the case, or if you have no /etc/environment at all, there are other ways to configure your variables. Good. Now, dear yum, would you mind?
 [lillo@pc-lillo ~]$ sudo yum check-update    
 Loaded plugins: langpacks, presto, refresh-packagekit  
 bumblebee-nonfree                           | 2.9 kB   00:00     
 google-chrome                               | 951 B    00:00     
 google-talkplugin                           | 951 B    00:00     
 rpmfusion-free-updates                      | 3.3 kB   00:00     
 rpmfusion-nonfree-updates                   | 3.3 kB   00:00     
 sublime2                                    | 1.3 kB   00:00     
 updates/17/x86_64/metalink                  | 29 kB    00:00     
 updates                                     | 4.6 kB   00:00     
 updates/primary_db                          | 8.2 MB   00:15     
 empathy.x86_64                              3.4.2.3-2.fc17       updates  
 kernel.x86_64                               3.8.12-100.fc17      updates  
 kernel-devel.x86_64                         3.8.12-100.fc17      updates  
 kernel-headers.x86_64                       3.8.12-100.fc17      updates  
 nspr.x86_64                                 4.9.6-1.fc17         updates  
Sweet.

No comments:

Post a Comment