Skip to content

Commit

Permalink
Clear yum fastest mirror cache
Browse files Browse the repository at this point in the history
Yum caches which mirror it deems is fastest.  This patch removes this
cache from yum based distros so that the first time the user runs yum,
it will re-determine which mirror is the fastest, which could easily
have changed from image creation time to the time a VM is spun up from
this image.
  • Loading branch information
David Wahlstrom committed Mar 31, 2015
1 parent 84dc726 commit 316b1c3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Centos-6.5/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ yum -y clean all
rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo
rm -rf VBoxGuestAdditions_*.iso

#cleanup yum fastest mirror cache
rm -f /var/cache/yum/timedhosts.txt

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
rm /etc/udev/rules.d/70-persistent-net.rules
3 changes: 3 additions & 0 deletions Centos-6.6/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ yum -y clean all
rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo
rm -rf VBoxGuestAdditions_*.iso

#cleanup yum fastest mirror cache
rm -f /var/cache/yum/timedhosts.txt

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
rm /etc/udev/rules.d/70-persistent-net.rules
3 changes: 3 additions & 0 deletions Centos-7.0/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ yum -y clean all
rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo
rm -rf VBoxGuestAdditions_*.iso

#cleanup yum fastest mirror cache
rm -f /var/cache/yum/timedhosts.txt

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
rm -f /etc/udev/rules.d/70-persistent-net.rules
3 changes: 3 additions & 0 deletions Fedora-20/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ yum -y erase gtk2 libX11 hicolor-icon-theme avahi bitstream-vera-fonts
yum -y clean all
rm -rf VBoxGuestAdditions_*.iso

#cleanup yum fastest mirror cache
rm -f /var/cache/yum/timedhosts.txt

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
3 changes: 3 additions & 0 deletions Fedora-21/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ yum -y erase gtk2 libX11 hicolor-icon-theme avahi bitstream-vera-fonts
yum -y clean all
rm -rf VBoxGuestAdditions_*.iso

#cleanup yum fastest mirror cache
rm -f /var/cache/yum/timedhosts.txt

# Remove traces of mac address from network configuration
sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0
rm /root/anaconda-ks.cfg

0 comments on commit 316b1c3

Please sign in to comment.