由于要兼容公司舊版本系統,所以使用docker 安裝centos5
啟動后發現yum無法使用
[root@d79f04fec1ef /]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
發現沒有/var/cache/yum/base/mirrorlist.txt
文件,就手動創建
echo "http://vault.centos.org/5.11/os/x86_64/" > /var/cache/yum/base/mirrorlist.txt
echo "http://vault.centos.org/5.11/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
echo "http://vault.centos.org/5.11/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt
還有報錯,這次提示是因為libselinux
> /etc/yum.repos.d/libselinux.repo
重新執行yum
恢復