Description of problem: yum-fastestmirror doesn't care about -C flag and tries to fetch mirrorlist even when no network access is available, which in turn terminates yum. Version-Release number of selected component (if applicable): yum-utils1.1.11-1.fc8.noarch How reproducible: Always Steps to Reproduce: 1. Make sure yum and yum-utils are installed. 2. Disconnect from network (like ifdown interface) 3. yum -C list Yum bails out while trying to get mirrorlist. 4. yum -C --noplugins list Should work, confirming that the source of the bug is in plugin. Actual results: $ LANG=C yum -C list Loading "presto" plugin Loading "fastestmirror" plugin Loading "security" plugin Loading "changelog" plugin Loading "downloadonly" plugin Setting up and reading Presto delta metadata No Presto metadata available for fedora No Presto metadata available for livna No Presto metadata available for updates Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')> Error: Cannot find a valid baseurl for repo: fedora Expected results: List of packages from local cache. Additional info:
yum-fastestmirror should cache it's results such that two back-to-back calls to yum list do not run the mirror check twice. yum-fastestmirror should not be invoked at all, even if it's cache is out of data, if the yum command does not require network access, such as yum info for an already installed package. yum-fastestmirror should fail silently when the network is not available. For example, yum list may decide to check the package list if not done recently, and this may cause yum-fastestmirror to check the mirrors if not done recently. If the route to the internet for the local network is down, yum list should work with the cached list of packages, perhaps with a warning. This means that yum-fastestmirror must be driven by the underlying yum commands need for network access -- it cannot simply be invoked unconditionally at yum startup time.
I believe I fixed this issue. Could you please test by throwing this in /usr/lib/yum-plugins http://lmacken.fedorapeople.org/fastestmirror.py Thanks!
Tested, fails. Brought down my external network interface, then tried: # yum -C list yum Loading "presto" plugin Loading "fastestmirror" plugin Loading "security" plugin Loading "changelog" plugin Loading "downloadonly" plugin Setting up and reading Presto delta metadata No Presto metadata available for fedora No Presto metadata available for livna Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was [Errno 4] IOError: <urlopen error (-2, 'Name or service not known')> Error: Cannot find a valid baseurl for repo: fedora Disabling all plugins or just fastestmirror works: # yum -C --noplugins list yum Installed Packages yum.noarch 3.2.8-2.fc8 installed Moving "if opts.cacheonly" check before "if loadcache" fixes this.
Ah, thanks. Fixed in 1e5a8cb86f744b6d38156247f16569675c0d6473 http://lmacken.fedorapeople.org/fastestmirror.py updated as well.
yum-utils-1.1.14-1.fc9 has been submitted as an update for Fedora 9
yum-utils-1.1.14-1.fc8 has been submitted as an update for Fedora 8
yum-utils-1.1.14-1.fc9 has been pushed to the Fedora 9 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update yum-utils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-4359
This has been fixed in yum-utils-1.1.14-4.fc9, which is now in the updates repository.