国内小伙伴推荐使用阿里云的源。Step1找到你需要的来源。阿里巴巴的开源镜像站,各种源都有。旧域名为https://mirrors.aliyun.com/Step2编辑CentOS7.repo文件,进入/etc/yum.repos.d,发现我的源还是7.4.1708[base]name=CentOS-$releasever-基础-mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7.4.1708/os/x86_64/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#releasedupdates[updates]name=CentOS-$releasever-更新-mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7.4.1708/updates/x86_64/#mirrorlist=http://mirrorlist。centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additionalpackagesthatmaybeuseful[extras]name=CentOS-$releasever-附加-mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7.4.1708/extras/x86_64/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additionalpackagesthat扩展现有组件的功能[centosplus]name=CentOS-$releasever-Plus-mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7.4.1708/centosplus/x86_64/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib-Centos的软件包用户[contrib]name=CentOS-$releasever-Contrib-mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/7.4.1708/contrib/x86_64/#mirrorlist=http://mirrorlist。centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7这个版本的源已经迁移到7.5.1804,→地址,用VIM替换:%s/7.4.1708/7.7.1908/gStep3修复冲报错误后更新系统测试yum-yupdate[root@liaogx~]#yum-yupdatePlugin"product-id"can'tbeimportedPlugin"search-disabled-repos"can'tbe未导入加载插件:fastestmirror从缓存主机文件加载镜像速度*base:mirrors.aliyun.com*epel:mirrors.tuna.tsinghua.edu.cn*extras:mirrors.aliyun.com*updates:mirrors.aliyun.comResolvingDependencies-->运行事务检查--->PackageModemManager.x86_640:1.6.0-2.el7willbeupdated......此处略......--->Packageyum-rhn-plugin.noarch0:2.0.1-10.el7将被安装-->运行事务检查--->Packagelibbytesize.x86_640:1.2-1.el7将被安装--->Packagepython2-pytoml.noarch0:0.1.18-1.el7将被安装--->Packagevolume_key-libs.x86_640:0.3.9-8.el7将被安装-->ProcessingConflict:initscripts-9.49.41-1.el7_5.1。x86_64冲突redhat-release<7.5-0.11-->FinishedDependencyResolutionError:initscripts与redhat-release-server-7.4-18.el7.x86_64冲突您可以尝试使用--skip-broken解决问题**发现2个预先存在的rpmdb问题,'yumcheck'输出如下:PackageKit-1.1.5-1.el7.centos.x86_64缺少PackageKit-backendrhn-check-2.0.2-17.el7.noarch的要求缺少yum-rhn-plugin>=('0','1.6.4','1')[root@liaogx~]#如果报如下错误Error:initscriptsconflictswithredhat-release-server-7.4-18.el7.x86_64这是更新的软件包与redhat的冲突导致的原始版本。通过关键字initscritps排除冲突的两种解决方法:yumupdate--exclude=kernel*--exclude=centos-release*--exclude=initscripts*删除冲突包:rpm-eredhat-release-server-7.4-18。el7.x86_64--nodeps这里使用第二种方法删除冲突的包[root@liaogx~]#rpm-eredhat-release-server-7.4-18.el7.x86_64--nodepswarning:file/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release:删除失败:没有这样的文件或目录警告:文件/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-rhx:删除失败:没有这样的文件或目录警告:文件/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-release:删除失败:没有这样的文件或目录警告:文件/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-former:删除失败:没有这样的文件或directorywarning:file/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta:removefailed:Nosuchfileordirectory[root@liaogx~]#Step4更新系统小白从入门到运行必须知道的,sudoyum-yupdate,老鸟都知道。[root@liaogx~]#yum-yupdate...此处省略10分钟...完成![root@liaogx~]#更新成功^_^搜索并关注微信公众号:寸土币号:bbcoins
