我们已知,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. php composer 报错 requires php ^7.1.8 || ^8.0 -> your php version

    php 环境变量版本低于7.1.8,更新php环境变量版本

  2. Axure中继器设置单选

    我们给元件添加组的名称是为了让软件知道哪些元件被放进了一个组中,然后软件会自动让这个组中只有一个元件能够是选中状态,以达到唯一被选中的效果.而中继器的这两个属性默认是启用的状态, 会把组的效果给取消, ...

  3. Postman:上传文件测试

    1.设置好接口地址与提交方法 2.设置header Content-Type:multipart/form-data 3.设置body 选择为:form-data key要和服务器端保持一致 选择好自 ...

  4. 浅谈Java中的Condition条件队列,手摸手带你实现一个阻塞队列!

    条件队列是什么?可能很多人和我一样答不出来,不过今天终于搞清楚了! 什么是条件队列 条件队列:当某个线程调用了wait方法,或者通过Condition对象调用了await相关方法,线程就会进入阻塞状态 ...

  5. LeetCode 151. 翻转字符串里的单词(Reverse Words in a String)

    151. 翻转字符串里的单词 151. Reverse Words in a String

  6. 基于卷积神经网络的人脸识别项目_使用Tensorflow-gpu+dilib+sklearn

    https://www.cnblogs.com/31415926535x/p/11001669.html 基于卷积神经网络的人脸识别项目_使用Tensorflow-gpu+dilib+sklearn ...

  7. 【IDEA使用技巧】(3) —— IntelliJ IDEA Maven配置

    1.IntelliJ IDEA Maven配置 1.1. Maven介绍与下载 Maven是一个项目管理工具,使用它能对Java项目中的jar包进行管理与项目构建,很好地解决了传统项目使用导包的方式管 ...

  8. [SOJ #537]不包含 [CF102129I]Incomparable Pairs(2019-8-6考试)

    题目大意:给定一个长度为$n$的字符串$s$,求有多少个无序字符串二元组$(x,y)$满足:$x,y$是$s$的字串,且$x$不是$y$的字串,$y$不是$x$的字串 题解:发现满足$x,y$是$s$ ...

  9. RequestBody只能读取一次的问题

    一.为什么只能读一次 原因很简单:因为是流.想想看,java中的流也是只能读一次,因为读完之后,position就到末尾了. 二.解决办法 思路:第一次读的时候,把流数据暂存起来.后面需要的时候,直接 ...

  10. NIO(2):Channel

    Channel可以理解为铁轨,Buffer是铁轨上的火车.铁轨的两端连接这文件描述符或者说文件的缓冲区和程序运行时的内存.借助NIO是一种更加符合OS底层文件系统的调用方式,使用NIO可以用更小的开销 ...