站長(zhǎng)資訊網(wǎng)
        最全最豐富的資訊網(wǎng)站

        詳解CentOS7更新YUM源步驟

        下面由centos教程欄目給大家介紹CentOS 7更新YUM源步驟,希望對(duì)需要的朋友有所幫助!

        國(guó)內(nèi)小伙伴推薦使用阿里云的源

        Step1 找到需要的源

        阿里巴巴開源鏡像站各種源應(yīng)有盡有,老域名是https://mirrors.aliyun.com/

        Step2 編輯CentOS7.repo文件

        進(jìn)入/etc/yum.repos.d,發(fā)現(xiàn)我的源還是7.4.1708

        [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7.4.1708/os/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7  #released updates [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7.4.1708/updates/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7  #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7.4.1708/extras/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7  #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7.4.1708/centosplus/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7  #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7.4.1708/contrib/x86_64/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

        這個(gè)版本的源已經(jīng)遷移到7.5.1804了,→地址,使用VIM將其替換

        :%s/7.4.1708/7.7.1908/g

        Step3 修復(fù)沖突報(bào)錯(cuò)

        然后更新系統(tǒng)試試yum -y update

        [root@liaogx ~]# yum -y update Plugin "product-id" can't be imported Plugin "search-disabled-repos" can't be imported Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile  * base: mirrors.aliyun.com  * epel: mirrors.tuna.tsinghua.edu.cn  * extras: mirrors.aliyun.com  * updates: mirrors.aliyun.com Resolving Dependencies --> Running transaction check ---> Package ModemManager.x86_64 0:1.6.0-2.el7 will be updated ......此處略...... ---> Package yum-rhn-plugin.noarch 0:2.0.1-10.el7 will be installed --> Running transaction check ---> Package libbytesize.x86_64 0:1.2-1.el7 will be installed ---> Package python2-pytoml.noarch 0:0.1.18-1.el7 will be installed ---> Package volume_key-libs.x86_64 0:0.3.9-8.el7 will be installed --> Processing Conflict: initscripts-9.49.41-1.el7_5.1.x86_64 conflicts redhat-release < 7.5-0.11 --> Finished Dependency Resolution Error: initscripts conflicts with redhat-release-server-7.4-18.el7.x86_64  You could try using --skip-broken to work around the problem ** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows: PackageKit-1.1.5-1.el7.centos.x86_64 has missing requires of PackageKit-backend rhn-check-2.0.2-17.el7.noarch has missing requires of yum-rhn-plugin >= ('0', '1.6.4', '1') [root@liaogx ~]#

        如果報(bào)如下錯(cuò)誤

        Error: initscripts conflicts with redhat-release-server-7.4-18.el7.x86_64

        這是更新軟件包是與原版本沖突造成的,有兩種解決辦法

        • 通過(guò)關(guān)鍵字initscritps排除沖突:yum update --exclude=kernel* --exclude=centos-release* --exclude=initscripts*
        • 刪除沖突包:rpm -e redhat-release-server-7.4-18.el7.x86_64 --nodeps

        這里使用第二種方法,把沖突的包干掉

        [root@liaogx ~]# rpm -e redhat-release-server-7.4-18.el7.x86_64 --nodeps warning: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release: remove failed: No such file or directory warning: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-rhx: remove failed: No such file or directory warning: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-release: remove failed: No such file or directory warning: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-legacy-former: remove failed: No such file or directory warning: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta: remove failed: No such file or directory [root@liaogx ~]#

        Step4 更新系統(tǒng)

        小白從入門到跑路必會(huì),sudo yum -y update,老鳥都懂。

        [root@liaogx ~]# yum -y update ......此處省略10分鐘...... Complete! [root@liaogx ~]#

        更新成功 ^_^

        贊(0)
        分享到: 更多 (0)
        網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)
        主站蜘蛛池模板: 国99精品无码一区二区三区| 国产精品国产亚洲精品看不卡| 91麻豆国产福利精品 | 亚洲热线99精品视频| 国自产精品手机在线观看视频| 精品国产午夜肉伦伦影院| 无码人妻精品一区二区蜜桃百度 | 欧美极品欧美精品欧美视频| 99精品福利国产在线| 久久精品国产一区二区| 亚洲精品亚洲人成在线观看| 国产午夜无码精品免费看 | 精品一区二区无码AV| 亚洲精品美女久久777777| 国产在线精品一区二区中文| 国产精品国产精品国产专区不卡| 视频二区国产精品职场同事| 精品人妻少妇一区二区三区| 日韩人妻无码精品久久久不卡| 99久久综合国产精品二区| 国产在线精品一区二区不卡麻豆| 亚洲精品高清在线| 国产精品欧美日韩| 国精品产露脸自拍| 国产精品186在线观看在线播放 | 青青青青久久精品国产| 欧美亚洲综合免费精品高清在线观看 | 国产精品永久免费视频| 婷婷国产成人精品视频| 91热成人精品国产免费| 亚洲欧洲国产精品香蕉网| 成人午夜精品久久久久久久小说 | 一区二区精品在线| 亚洲AV无码久久精品成人| 一区二区三区日韩精品| 亚洲AV永久纯肉无码精品动漫| 国产精品美女网站在线观看| 久久国产精品成人影院| 亚洲国产精品尤物YW在线观看| 国产高清在线精品一区二区| 99热在线日韩精品免费|