[centos][yum] centos升级到特定版本

我们已知,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.1406 - Base                                                                                                                   disabled
C7.0.1406-centosplus/x86_64                                                                          CentOS-7.0.1406 - CentOSPlus                                                                                                             disabled
C7.0.1406-extras/x86_64                                                                              CentOS-7.0.1406 - Extras                                                                                                                 disabled
C7.0.1406-fasttrack/x86_64                                                                           CentOS-7.0.1406 - Fasttrack                                                                                                              disabled
C7.0.1406-updates/x86_64                                                                             CentOS-7.0.1406 - Updates                                                                                                                disabled
C7.1.1503-base/x86_64                                                                                CentOS-7.1.1503 - Base                                                                                                                   disabled
C7.1.1503-centosplus/x86_64                                                                          CentOS-7.1.1503 - CentOSPlus                                                                                                             disabled
C7.1.1503-extras/x86_64                                                                              CentOS-7.1.1503 - Extras                                                                                                                 disabled
C7.1.1503-fasttrack/x86_64                                                                           CentOS-7.1.1503 - Fasttrack                                                                                                              disabled
C7.1.1503-updates/x86_64                                                                             CentOS-7.1.1503 - Updates                                                                                                                disabled
C7.2.1511-base/x86_64                                                                                CentOS-7.2.1511 - Base                                                                                                                   disabled
C7.2.1511-centosplus/x86_64                                                                          CentOS-7.2.1511 - CentOSPlus                                                                                                             disabled
C7.2.1511-extras/x86_64                                                                              CentOS-7.2.1511 - Extras                                                                                                                 disabled
C7.2.1511-fasttrack/x86_64                                                                           CentOS-7.2.1511 - Fasttrack                                                                                                              disabled
C7.2.1511-updates/x86_64                                                                             CentOS-7.2.1511 - Updates                                                                                                                disabled
C7.3.1611-base/x86_64                                                                                CentOS-7.3.1611 - Base                                                                                                                   disabled
C7.3.1611-centosplus/x86_64                                                                          CentOS-7.3.1611 - CentOSPlus                                                                                                             disabled
C7.3.1611-extras/x86_64                                                                              CentOS-7.3.1611 - Extras                                                                                                                 disabled
C7.3.1611-fasttrack/x86_64                                                                           CentOS-7.3.1611 - Fasttrack                                                                                                              disabled
C7.3.1611-updates/x86_64                                                                             CentOS-7.3.1611 - Updates                                                                                                                disabled
C7.4.1708-base/x86_64                                                                                CentOS-7.4.1708 - Base                                                                                                                   disabled
C7.4.1708-centosplus/x86_64                                                                          CentOS-7.4.1708 - CentOSPlus                                                                                                             disabled
C7.4.1708-extras/x86_64                                                                              CentOS-7.4.1708 - Extras                                                                                                                 disabled
C7.4.1708-fasttrack/x86_64                                                                           CentOS-7.4.1708 - Fasttrack                                                                                                              disabled
C7.4.1708-updates/x86_64                                                                             CentOS-7.4.1708 - Updates                                                                                                                disabled
C7.5.1804-base/x86_64                                                                                CentOS-7.5.1804 - Base                                                                                                                   disabled
C7.5.1804-centosplus/x86_64                                                                          CentOS-7.5.1804 - CentOSPlus                                                                                                             disabled
C7.5.1804-extras/x86_64                                                                              CentOS-7.5.1804 - Extras                                                                                                                 disabled
C7.5.1804-fasttrack/x86_64                                                                           CentOS-7.5.1804 - Fasttrack                                                                                                              disabled
C7.5.1804-updates/x86_64                                                                             CentOS-7.5.1804 - Updates                                                                                                                disabled
C7.6.1810-base/x86_64                                                                                CentOS-7.6.1810 - Base                                                                                                                   disabled
C7.6.1810-centosplus/x86_64                                                                          CentOS-7.6.1810 - CentOSPlus                                                                                                             disabled
C7.6.1810-extras/x86_64                                                                              CentOS-7.6.1810 - Extras                                                                                                                 disabled
C7.6.1810-fasttrack/x86_64                                                                           CentOS-7.6.1810 - Fasttrack                                                                                                              disabled
C7.6.1810-updates/x86_64                                                                             CentOS-7.6.1810 - Updates                                                                                                                disabled
base/7/x86_64                                                                                        CentOS-7 - Base                                                                                                                          enabled: 10,097
base-debuginfo/x86_64                                                                                CentOS-7 - Debuginfo                                                                                                                     enabled:  7,293
base-source/7                                                                                        CentOS-7 - Base Sources                                                                                                                  enabled:      0
!c7-media                                                                                            CentOS-7 - Media                                                                                                                         disabled
centosplus/7/x86_64                                                                                  CentOS-7 - Plus                                                                                                                          disabled
centosplus-source/7                                                                                  CentOS-7 - Plus Sources                                                                                                                  enabled:      0
cr/7/x86_64                                                                                          CentOS-7 - cr                                                                                                                            disabled
epel/x86_64                                                                                          Extra Packages for Enterprise Linux 7 - x86_64                                                                                           enabled: 13,485
epel-debuginfo/x86_64                                                                                Extra Packages for Enterprise Linux 7 - x86_64 - Debug                                                                                   disabled
!epel-source/x86_64                                                                                  Extra Packages for Enterprise Linux 7 - x86_64 - Source                                                                                  disabled
epel-testing/x86_64                                                                                  Extra Packages for Enterprise Linux 7 - Testing - x86_64                                                                                 disabled
epel-testing-debuginfo/x86_64                                                                        Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug                                                                         disabled
epel-testing-source/x86_64                                                                           Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source                                                                        disabled
extras/7/x86_64                                                                                      CentOS-7 - Extras                                                                                                                        enabled:    305
extras-source/7                                                                                      CentOS-7 - Extras Sources                                                                                                                enabled:      0
fasttrack/7/x86_64                                                                                   CentOS-7 - fasttrack                                                                                                                     disabled
updates/7/x86_64                                                                                     CentOS-7 - Updates                                                                                                                       enabled:    953
updates-source/7                                                                                     CentOS-7 - Updates Sources                                                                                                               enabled:      0
repolist: 32,133

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 常见问题

7.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.:

         1. 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.

         2. 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.

         3. 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-219-42.el7_4.10.i686 != systemd-libs-219-57.el7.x86_64
Error: Protected multilib versions: elfutils-libs-0.168-8.el7.i686 != elfutils-libs-0.170-4.el7.x86_64
Error: Protected multilib versions: libselinux-2.5-11.el7.i686 != libselinux-2.5-14.1.el7.x86_64
Error: Protected multilib versions: elfutils-libelf-0.168-8.el7.i686 != elfutils-libelf-0.170-4.el7.x86_64
Error: Protected multilib versions: pam-1.1.8-18.el7.i686 != pam-1.1.8-22.el7.x86_64
Error: Protected multilib versions: nss-softokn-freebl-3.28.3-8.el7_4.i686 != nss-softokn-freebl-3.36.0-5.el7_5.x86_64
Error: Protected multilib versions: libsepol-2.5-6.el7.i686 != libsepol-2.5-10.el7.x86_64

没有解决。。。

原文地址:https://www.cnblogs.com/hugetong/p/11991702.html

时间: 2024-08-29 20:18:11

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

CentOS yum 安装LAMP PHP5.4版本

CentOS yum 安装LAMP PHP5.4版本     [字体:大 中 小] Linux系统版本:CentOS 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源代码编译安装大概需要2个小时,好处在于可以自己配置地址等一些参数,yum安装半个小时搞定,一般不会出错,更新也很方便. 2.我的机器是CentOS release 5.9 64为的系统,一般机器都

Centos 6.6 升级openSSH 远程访问版本(5.3升级7.0源码安装版)

由于服务器Openssh 版本过低,存在不安全因素,所以最近想把服务器都进行升级: 查看当前系统版本为6.6,openssh为5.3版本,此版本启用默认是开启了root远程功能的,因此我能直接通过ROOT进行远程访问. 话不多说,直接上传下载的OPENSSL7.0版本压缩包,需要的可以到http://www.openssh.com官网下载 上传后解压,tar zxf openssh-7.0p1.ta.gz ,然后进cd openssh-7.01p1 目录. ./configure --prefi

centos 6.4 升级python到版本2.7.12

注意:需要root权限 查看python版本:python --version 1.下载Python-2.7.12wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz 2.解压tar   zxvf   Python-2.7.12.tgz 3.更改工作目录cd Python-2.7.12 4.安装./configure  make all             make install  make clean  make

CentOS服务器单独升级 php5.1 到 5.2版本

引言:使用CentOS 5.5系统的朋友们都知道,yum默认安装的php版本为php5.1,我们要想使用最新的稳定版本(php5.2.x系列),就必须编译安装.下面教大家如何使用yum来选择安装自己需要的php版本!以下操作均在终端命令行下进行!rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andywget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webta

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

网上有不少升级CentOS内核的文章,如<CentOS 6.5 升级内核到 3.10.28>,大部分都是下载源码编译,有点麻烦. 在yum的ELRepo源中,有mainline(3.13.1).long-term(3.10.28)这2个内核版本,考虑到long-term更稳定,会长期更新,所以选择这个版本. 1.导入public key 1 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 2.安装ELRepo到CentOS-

CentOS 6.4升级Python导致yum无法使用

1.查看当前系统python的版本 1python -V 2.下载2.7.3版本的Python 1wget http://    python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 3.解压和安装 tar -jxvf Python-2.7.3.tar.bz2 #进入解压后的目录 cd Python-2.7.3 #编译和安装 ./configure make make install 4.查看是否安装成功 /usr/local/bin/python2.

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

因开发需要,今天把CentOS 6.5自带的Python2.6.6升级到了Python2.7.3.按照如下步骤进行升级 1.查看当前系统python的版本 python -V 2.下载2.7.3版本的Python wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 3.解压和安装 tar -jxvf Python-2.7.3.tar.bz2 #进入解压后的目录 cd Python-2.7.3 #编译和安装 ./configur

centos yum升级php

centos yum升级php5.3.3到最5.6.3 不要轻易升级,否则后果很严重! 注意事项: 1 升级后之前的php扩展不会丢失 自动会安装对应最新php的扩展2 升级后需重启下apache 才能看到3 升级时候会提示 Loaded plugins: fastestmirror Determining fastest mirrors 参考后面修改,重新执行即可 4 如果失败一般是yum源的问题 注意是对应的64位 centos6.5的php预设5.3.3这个版本,其实对centos来说就是

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

原文地址:https://www.cnblogs.com/lzpong/p/5755678.html 我这里是centos7 升级到gcc8.1,过程差不多,参考这篇文章,记录一下. ---原文--- CentOS 6.6 升级GCC G++ (当前最新GCC/G++版本为v6.1.0) 没有便捷方式, yum update....   yum install 或者 添加yum 的 repo 文件 也不行, 只能更新到 4.4.7! then,  只能手动编译安装了,那么开始第一步下载源代码吧,