欢迎来到电脑知识学习网,专业的电脑知识大全学习平台!

手机版

win7wzcsvc-()

电脑基础 发布时间:2022-12-27 02:00:40
win7wzcsvc () 前言

功能说明:自动检测系统并更新源。

适用系统:兼容线上所有 Linux 版本。

注意事项:由于系统版本都有支持的周期所以部分源可能会出现不可用的情况,包括官方的源,这是正常情况。

千锤百炼过的,无脑四步走就行,前提是服务器可以访问外网!!

1.导入CentOS-6的GPG证书

# rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

[root@node1 hwb]# ll总用量 79532-rw-r--r-- 1 root root 2006 6月 18 05:49 CentOS6-Base-163.repo-rwxr-xr-x. 1 root root 81407719 2月 15 23:26 etest.war-rw-r--r-- 1 root root 1706 6月 18 05:53 RPM-GPG-KEY-CentOS-6drwxrwxrwx. 2 root root 4096 4月 4 21:57 test-rwxr-xr-x 1 root root 13944 2月 27 2015 update_source.sh-rw-r--r-- 1 root root 2122 6月 18 05:43 update_source.tgz[root@node1 hwb]# cat RPM-GPG-KEY-CentOS-6 -----BEGIN PGP PUBLIC KEY BLOCK-----Version: GnuPG v1.4.5 电脑 (GNU/Linux)mQINBE4P06MBEACqn48FZgYkG2QrtUAVDV58H6LpDYEcTcv4CIFSkgs6dJ9TavCWNyPBZRpM2R+Rg5eVqlborp7TmktBP/sSsxc8eJ+3P2aQWSWc5ol74Y0OznJUCrBrbIdypJllsD9Fe+h7gLBXTh3vdBEWr2lR+xA+Oou8UlO2gFbVFQqMafUgU1s0vqaE/hHH0TzwD0/tJ6eqIbHwVR/Bu6kHFK4PwePovhfvyYD9Y+C0vOYd5Ict2vbLHz1fQBDZObv4M6KN3j7nzme47hKtdMd+LwFqxM5cXfM6b5doDulWPmuGV78VoX6OR7elx1tlfpuiFeuXYnImm5nTawArcQ1UkXUSYcTUKShJebRDLR3BycxR39Q9jtbOQ29RFumHginovEhdUcinRr22eRXgcmzpR00zFIWoFCwHh/OCtG14nFhefuZ8Z80qbVhW2J9+/O4tksv9HtQBmQNOK5S8C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M==jrWY-----END PGP PUBLIC KEY BLOCK-----[root@node1 hwb]# rpm --import RPM-GPG-KEY-CentOS-6 [root@node1 hwb]# 2.让yum使用网易的源

#cd /etc/yum.repos.d/

#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

#mv CentOS6-Base-163.repo CentOS-Base-163.repo

[root@node1 ~]# cd /etc/yum.repos.d/[root@node1 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo--2017-06-23 01:51:27-- http://mirrors.163.com/.help/CentOS6-Base-163.repo正在解析主机 mirrors.163.com... 123.58.173.186, 123.58.173.185正在连接 电脑 mirrors.163.com|123.58.173.186|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:2006 (2.0K) [application/octet-stream]正在保存至: “CentOS6-Base-163.repo”100%[=============================================================================================================================>] 2,006 --.-K/s in 0.001s 2017-06-23 01:51:27 (2.03 MB/s) - 已保存 “CentOS6-Base-163.repo” [2006/2006])[root@node1 yum.repos.d]# ll总用量 12drwxr-xr-x. 2 root root 4096 6月 18 05:40 backup-rw-r--r-- 1 root root 2006 9月 18 2014 CentOS6-Base-163.repo[root@node1 yum.repos.d]# mv CentOS6-Base-163.repo CentOS-Base-163.repo[root@node1 yum.repos.d]# ll总用量 8drwxr-xr-x. 2 root root 4096 6月 18 05:40 backup-rw-r--r-- 1 root root 2006 9月 18 2014 CentOS-Base-163.repo3.修改repo文件在所有mirrorlist前面加上#,把所有$releasever替换成6,保存

sed -i '/mirrorlist/d' CentOS-Base-163.reposed -i '/\[addons\]/,/^$/d' CentOS-Base-163.reposed -i 's/\$releasever/6/' CentOS-Base-163.reposed -i 's/RPM-GPG-KEY-CentOS-5/RPM-GPG-KEY-CentOS-6/' CentOS-Base-163.repo[root@node1 桌面]# cat /etc/yum.repos.d/CentOS-Base-163.repo # CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.# remarked out baseurl= line instead.[base]name=CentOS-6 - Base - 163.combaseurl=http://mirrors.163.com/centos/6/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates [updates]name=CentOS-6 - Updates - 163.combaseurl=http://mirrors.163.com/centos/6/updates/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-6 - Extras - 163.combaseurl=http://mirrors.163.com/centos/6/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-6 - Plus - 163.combaseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-6 - Contrib - 163.combaseurl=http://mirrors.163.com/centos/6/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-64、清理并重新生成yum缓存

#yum clean metadata

#yum makecache

yum源

觉得有用的走波关注呗~


电脑
责任编辑:电脑知识学习网