我们已知,yum upgrade命令可以将整个系统升级到最新版本。

但是很多时候,我们需要更新到指定版本,比如,当前最新的CentOS版本是7.6.1810

但是我需要更新到7.4,可以如下这样做:

1.  CentOS的repo是不维护历史版本的。所有历史版本都在这里,

http://vault.centos.org/

在OS里,有这样的一个repo, /etc/yum.repos.d/CentOS-Vault.repo

里边是,当前版本之前的历史版本。所以里边没有7.4 。

2.  更新centos-release包,拿到7,4的vault

yum install centos-release

3  查看所有可用的repo

yum repolist all

详见:

repo id                                                                                              repo name                                                                                                                                status
C7.0.1406-base/x86_64 CentOS-7.0. - Base disabled
C7.0.1406-centosplus/x86_64 CentOS-7.0. - CentOSPlus disabled
C7.0.1406-extras/x86_64 CentOS-7.0. - Extras disabled
C7.0.1406-fasttrack/x86_64 CentOS-7.0. - Fasttrack disabled
C7.0.1406-updates/x86_64 CentOS-7.0. - Updates disabled
C7.1.1503-base/x86_64 CentOS-7.1. - Base disabled
C7.1.1503-centosplus/x86_64 CentOS-7.1. - CentOSPlus disabled
C7.1.1503-extras/x86_64 CentOS-7.1. - Extras disabled
C7.1.1503-fasttrack/x86_64 CentOS-7.1. - Fasttrack disabled
C7.1.1503-updates/x86_64 CentOS-7.1. - Updates disabled
C7.2.1511-base/x86_64 CentOS-7.2. - Base disabled
C7.2.1511-centosplus/x86_64 CentOS-7.2. - CentOSPlus disabled
C7.2.1511-extras/x86_64 CentOS-7.2. - Extras disabled
C7.2.1511-fasttrack/x86_64 CentOS-7.2. - Fasttrack disabled
C7.2.1511-updates/x86_64 CentOS-7.2. - Updates disabled
C7.3.1611-base/x86_64 CentOS-7.3. - Base disabled
C7.3.1611-centosplus/x86_64 CentOS-7.3. - CentOSPlus disabled
C7.3.1611-extras/x86_64 CentOS-7.3. - Extras disabled
C7.3.1611-fasttrack/x86_64 CentOS-7.3. - Fasttrack disabled
C7.3.1611-updates/x86_64 CentOS-7.3. - Updates disabled
C7.4.1708-base/x86_64 CentOS-7.4. - Base disabled
C7.4.1708-centosplus/x86_64 CentOS-7.4. - CentOSPlus disabled
C7.4.1708-extras/x86_64 CentOS-7.4. - Extras disabled
C7.4.1708-fasttrack/x86_64 CentOS-7.4. - Fasttrack disabled
C7.4.1708-updates/x86_64 CentOS-7.4. - Updates disabled
C7.5.1804-base/x86_64 CentOS-7.5. - Base disabled
C7.5.1804-centosplus/x86_64 CentOS-7.5. - CentOSPlus disabled
C7.5.1804-extras/x86_64 CentOS-7.5. - Extras disabled
C7.5.1804-fasttrack/x86_64 CentOS-7.5. - Fasttrack disabled
C7.5.1804-updates/x86_64 CentOS-7.5. - Updates disabled
C7.6.1810-base/x86_64 CentOS-7.6. - Base disabled
C7.6.1810-centosplus/x86_64 CentOS-7.6. - CentOSPlus disabled
C7.6.1810-extras/x86_64 CentOS-7.6. - Extras disabled
C7.6.1810-fasttrack/x86_64 CentOS-7.6. - Fasttrack disabled
C7.6.1810-updates/x86_64 CentOS-7.6. - Updates disabled
base//x86_64 CentOS- - Base enabled: ,
base-debuginfo/x86_64 CentOS- - Debuginfo enabled: ,
base-source/ CentOS- - Base Sources enabled:
!c7-media CentOS- - Media disabled
centosplus//x86_64 CentOS- - Plus disabled
centosplus-source/ CentOS- - Plus Sources enabled:
cr//x86_64 CentOS- - cr disabled
epel/x86_64 Extra Packages for Enterprise Linux - x86_64 enabled: ,
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux - x86_64 - Debug disabled
!epel-source/x86_64 Extra Packages for Enterprise Linux - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux - Testing - x86_64 - Source disabled
extras//x86_64 CentOS- - Extras enabled:
extras-source/ CentOS- - Extras Sources enabled:
fasttrack//x86_64 CentOS- - fasttrack disabled
updates//x86_64 CentOS- - Updates enabled:
updates-source/ CentOS- - Updates Sources enabled:
repolist: ,

4 清空缓存

yum clean all
rm -f /var/cache/yum

5 安装更新

通过对3中repo id的查询,可用使用如下命令,进行全局更新到指定版本

yum --disablerepo='*' --enablerepo='C7.4*' upgrade

6 更新指定软件

yum --disablerepo='*' --enablerepo='C7.4*,epel' update kernel

7 回到正确的release

centos-release是版本标识,我们应该始终保持它指示着正确的信息。

将centos-release包降级回7.4, 之后所有的默认repo便都指向了7.4。

yum --disablerepo="*" --enablerepo="C7.4.1708-*" --enablerepo="epel*" downgrade centos-release

8 常见问题

8.1

Error:  Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.: . You have an upgrade for systemd-libs which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of systemd-libs of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude systemd-libs.otherarch ... this should give you an error
message showing the root cause of the problem. . You have multiple architectures of systemd-libs installed, but
yum can only see an upgrade for one of those architectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work. . You have duplicate versions of systemd-libs installed already.
You can use "yum check" to get yum show these errors. ...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems). Protected multilib versions: systemd-libs--.el7_4..i686 != systemd-libs--.el7.x86_64
Error: Protected multilib versions: elfutils-libs-0.168-.el7.i686 != elfutils-libs-0.170-.el7.x86_64
Error: Protected multilib versions: libselinux-2.5-.el7.i686 != libselinux-2.5-14.1.el7.x86_64
Error: Protected multilib versions: elfutils-libelf-0.168-.el7.i686 != elfutils-libelf-0.170-.el7.x86_64
Error: Protected multilib versions: pam-1.1.-.el7.i686 != pam-1.1.-.el7.x86_64
Error: Protected multilib versions: nss-softokn-freebl-3.28.-.el7_4.i686 != nss-softokn-freebl-3.36.-.el7_5.x86_64
Error: Protected multilib versions: libsepol-2.5-.el7.i686 != libsepol-2.5-.el7.x86_64

没有解决。。。

[centos][yum] centos升级到特定版本的更多相关文章

  1. CentOS yum 安装LAMP PHP5.4版本

    CentOS yum 安装LAMP PHP5.4版本 [日期:2015-06-04] 来源:Linux社区  作者:rogerzhanglijie [字体:大 中 小]     Linux系统版本:C ...

  2. centos 6.4 升级python到版本2.7.12

    注意:需要root权限 查看python版本:python --version 1.下载Python-2.7.12wget https://www.python.org/ftp/python/2.7. ...

  3. Centos 6.5 升级python到版本2.7.12

    查看python版本: python --version 1.下载Python-2.7.12 wget https://www.python.org/ftp/python/2.7.12/Python- ...

  4. yum-cron更新 CentOS yum update 不升级内核版本方法

    http://www.360doc.com/content/15/0608/17/15798950_476597844.shtml 相关yum-cron说明有一些 CentOS yum update ...

  5. CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)

    ---恢复内容开始--- CentOS 6.6 升级GCC G++ (当前最新GCC/G++版本为v6.1.0) 没有便捷方式, yum update....   yum install 或者 添加y ...

  6. CentOS 6.5升级Python后yum不可用的解决方案

    因开发需要,今天把CentOS 6.5自带的Python2.6.6升级到了Python2.7.3.按照如下步骤进行升级 1.查看当前系统python的版本 python -V 2.下载2.7.3版本的 ...

  7. 使用yum快速升级CentOS 6.5内核到 3.10.28

    网上有不少升级CentOS内核的文章,如<CentOS 6.5 升级内核到 3.10.28>,大部分都是下载源码编译,有点麻烦. 在yum的ELRepo源中,有mainline(3.13. ...

  8. CentOS 6下升级Python版本

    CentOS6.8默认的python版本是2.6,而现在好多python组件开始只支持2.7以上的版本,比如说我今天遇到的pip install pysqlite,升级python版本是一个痛苦但又常 ...

  9. 【转】CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)

    原文地址:https://www.cnblogs.com/lzpong/p/5755678.html 我这里是centos7 升级到gcc8.1,过程差不多,参考这篇文章,记录一下. ---原文--- ...

随机推荐

  1. Laya页面嵌套和Scene.destory导致的Bug

    Laya2.1.1.1 参考: 预设使用 Laya给出了相同模块,逻辑代码也相同情况下,使用页面嵌+runtime的使用方案.但是该方案和Laya.Scene.open,Laya.Scene.dest ...

  2. 取未清PO逻辑

    注意这里的 GR qty [   WEMNG] 和 Open Quantity [OBMNG] *&---------------------------------------------- ...

  3. [LeetCode] 128. Longest Consecutive Sequence 求最长连续序列

    Given an unsorted array of integers, find the length of the longest consecutive elements sequence. F ...

  4. kexue shangwang

    根据实践,pptp.IPsec甚至OpenVPN等kexue上网法已经无法顺利翻越GFW.通过抓包可知,GFW会将pptp的握手期间的ack包吞掉,导致本地一直无法收到服务器端的响应.而OpenVPN ...

  5. linux : 各个发行版中修改python27默认编码为utf-8

    该方法可解决robot报错:'ascii' codec can't encode character u'\xf1' in position 16: ordinal not in  range(128 ...

  6. POJ8469 特殊密码锁

    总时间限制: 1000ms 内存限制: 1024kB 描述 有一种特殊的二进制密码锁,由n个相连的按钮组成(n<30),按钮有凹/凸两种状态,用手按按钮会改变其状态. 然而让人头疼的是,当你按一 ...

  7. 悬架的灵魂——K&C特性

    静止便是死亡,只有运动才能敲开永生的大门     —  泰戈尔 KC特性是车辆操控稳定性的直接影响者!可以分为 K ( Kinematic) 特性和 C( Compliance) 特性: K 特性即悬 ...

  8. LeetCode 503. 下一个更大元素 II(Next Greater Element II)

    503. 下一个更大元素 II 503. Next Greater Element II 题目描述 给定一个循环数组(最后一个元素的下一个元素是数组的第一个元素),输出每个元素的下一个更大元素.数字 ...

  9. LeetCode 445. 两数相加 II(Add Two Numbers II)

    445. 两数相加 II 445. Add Two Numbers II 题目描述 给定两个非空链表来代表两个非负整数.数字最高位位于链表开始位置.它们的每个节点只存储单个数字.将这两数相加会返回一个 ...

  10. DP(动态规划)总结

    前言 动态规划是很重要的一个知识点,大大小小的比赛总会有一两道DP题,足以说明动态规划的重要性. 动态规划主要是思想,并没有固定的模板,那么,怎么判断题目是不是动态规划呢? DP题一般都会满足三个条件 ...