试了几个都不行了。腾讯云没有这镜像了
https://www.nodeseek.com/post-612994-1
会卡tmp/web需要手工卡
vi /trans.sh
我是直接手动wget /tmp/web$web_path 改成 /tmp/web/index.hmtl
不能更新解决办法
第 1 步:先看有哪些 repo 文件和重复项
bash
已复制
ls -l /etc/yum.repos.d/
grep -R '^[extras]' /etc/yum.repos.d/
如果看到类似 CentOS-Extras.repo 或 CentOS-Linux-*.repo(旧的 CentOS Linux 8 残留),把它备份后移走:
bash
已复制
mkdir -p /etc/yum.repos.d/backup
mv /etc/yum.repos.d/CentOS-Extras.repo /etc/yum.repos.d/backup/ 2>/dev/null
mv /etc/yum.repos.d/CentOS-Linux-*.repo /etc/yum.repos.d/backup/ 2>/dev/null
第 2 步:把 Stream 8 的源指向 vault.centos.org(归档镜像)
bash
复制
sed -i
-e 's|^mirrorlist=|#mirrorlist=|'
-e 's|^#baseurl=http://mirror.centos.org/\$contentdir/\$stream/|baseurl=https://vault.centos.org/\$stream/|'
/etc/yum.repos.d/CentOS-Stream-*.repo
这条命令做两件事:注释掉失效的 mirrorlist=,并把被注释的 baseurl 解开、域名改成 vault.centos.org。
改完后确认一下(可选):
bash
复制
cat /etc/yum.repos.d/CentOS-Stream-BaseOS.repo
正常情况下 BaseOS/AppStream 的 baseurl 会变成:
code
复制
baseurl=https://vault.centos.org/$stream/BaseOS/$basearch/os/
baseurl=https://vault.centos.org/$stream/AppStream/$basearch/os/
第 3 步:清缓存并重试
bash
复制
yum clean all
yum makecache
yum update