赞
踩
切换到yum目录下
- [root@localhost /]# cd /etc/yum.repos.d/
- [root@localhost yum.repos.d]# ls
- redhat.repo
创建并编辑新的文件
- [root@localhost yum.repos.d]# vi my.repo
-
- [base]
- name=CentOS-$releasever - Base - mirrors.aliyun.com
- failovermethod=priority
- baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/
- gpgcheck=1
- enabled=1
- gpgkey=http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
以下两个命令执行其中一个即可,我这里用的是yum update
yum update
升级所有包,会保留
旧版本的 package,更新系统内核根据 obsoletes 配置而定yum upgrade
升级所有包,会删除
旧版本的 package,更新系统内核
- [root@localhost yum.repos.d]# yum update
- 已加载插件:product-id, search-disabled-repos, subscription-manager
-
- This system is not registered with an entitlement server. You can use subscription-manager to register.
-
- base | 3.6 kB 00:00:00
- (1/2): base/group_gz | 153 kB 00:00:00
- (2/2): base/primary_db | 6.1 MB 00:00:16
- 正在解决依赖关系
- --> 正在检查事务
- ---> 软件包 basesystem.noarch.0.10.0-7.el7 将被 升级
- ---> 软件包 basesystem.noarch.0.10.0-7.el7.centos 将被 更新
- ---> 软件包 centos-logos.noarch.0.70.0.6-3.el7.centos 将被 舍弃
- ---> 软件包 dhclient.x86_64.12.4.2.5-82.el7 将被 升级
- ---> 软件包 dhclient.x86_64.12.4.2.5-82.el7.centos 将被 更新
- ---> 软件包 dhcp-common.x86_64.12.4.2.5-82.el7 将被 升级
- ---> 软件包 dhcp-common.x86_64.12.4.2.5-82.el7.centos 将被 更新
- ---> 软件包 dhcp-libs.x86_64.12.4.2.5-82.el7 将被 升级
- ---> 软件包 dhcp-libs.x86_64.12.4.2.5-82.el7.centos 将被 更新
- ---> 软件包 plymouth.x86_64.0.0.8.9-0.34.20140113.el7 将被 升级
- ---> 软件包 plymouth.x86_64.0.0.8.9-0.34.20140113.el7.centos 将被 更新
- ---> 软件包 plymouth-core-libs.x86_64.0.0.8.9-0.34.20140113.el7 将被 升级
- ---> 软件包 plymouth-core-libs.x86_64.0.0.8.9-0.34.20140113.el7.centos 将被 更新
- ---> 软件包 plymouth-scripts.x86_64.0.0.8.9-0.34.20140113.el7 将被 升级
- ---> 软件包 plymouth-scripts.x86_64.0.0.8.9-0.34.20140113.el7.centos 将被 更新
- ---> 软件包 python-syspurpose.x86_64.0.1.24.42-1.el7 将被 升级
- ---> 软件包 python-syspurpose.x86_64.0.1.24.42-1.el7.centos 将被 更新
- ---> 软件包 redhat-logos.noarch.0.70.7.0-1.el7 将被 取代
- ---> 软件包 subscription-manager.x86_64.0.1.24.42-1.el7 将被 升级
- ---> 软件包 subscription-manager.x86_64.0.1.24.42-1.el7.centos 将被 更新
- ---> 软件包 subscription-manager-rhsm.x86_64.0.1.24.42-1.el7 将被 升级
- ---> 软件包 subscription-manager-rhsm.x86_64.0.1.24.42-1.el7.centos 将被 更新
- ---> 软件包 subscription-manager-rhsm-certificates.x86_64.0.1.24.42-1.el7 将被 升级
- ---> 软件包 subscription-manager-rhsm-certificates.x86_64.0.1.24.42-1.el7.centos 将被 更新
- ---> 软件包 yum.noarch.0.3.4.3-168.el7 将被 升级
- ---> 软件包 yum.noarch.0.3.4.3-168.el7.centos 将被 更新
- --> 正在处理依赖关系 yum-plugin-fastestmirror,它被软件包 yum-3.4.3-168.el7.centos.noarch 需要
- --> 正在检查事务
- ---> 软件包 yum-plugin-fastestmirror.noarch.0.1.1.31-54.el7_8 将被 安装
- --> 解决依赖关系完成
-
- 依赖关系解决
-
- =================================================================================================
- Package 架构 版本 源 大小
- =================================================================================================
- 正在安装:
- centos-logos noarch 70.0.6-3.el7.centos base 21 M
- 替换 redhat-logos.noarch 70.7.0-1.el7
- 正在更新:
- basesystem noarch 10.0-7.el7.centos base 5.0 k
- dhclient x86_64 12:4.2.5-82.el7.centos base 286 k
- dhcp-common x86_64 12:4.2.5-82.el7.centos base 176 k
- dhcp-libs x86_64 12:4.2.5-82.el7.centos base 133 k
- plymouth x86_64 0.8.9-0.34.20140113.el7.centos base 116 k
- plymouth-core-libs x86_64 0.8.9-0.34.20140113.el7.centos base 108 k
- plymouth-scripts x86_64 0.8.9-0.34.20140113.el7.centos base 39 k
- python-syspurpose x86_64 1.24.42-1.el7.centos base 273 k
- subscription-manager x86_64 1.24.42-1.el7.centos base 1.1 M
- subscription-manager-rhsm x86_64 1.24.42-1.el7.centos base 331 k
- subscription-manager-rhsm-certificates x86_64 1.24.42-1.el7.centos base 236 k
- yum noarch 3.4.3-168.el7.centos base 1.2 M
- 为依赖而安装:
- yum-plugin-fastestmirror noarch 1.1.31-54.el7_8 base 34 k
-
- 事务概要
- =================================================================================================
- 安装 1 软件包 (+1 依赖软件包)
- 升级 12 软件包
-
- 总下载量:25 M
- Is this ok [y/d/N]: y
- Downloading packages:
- Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
- 警告:/var/cache/yum/x86_64/7Server/base/packages/basesystem-10.0-7.el7.centos.noarch.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
- basesystem-10.0-7.el7.centos.noarch.rpm 的公钥尚未安装
- (1/14): basesystem-10.0-7.el7.centos.noarch.rpm | 5.0 kB 00:00:00
- (2/14): dhclient-4.2.5-82.el7.centos.x86_64.rpm | 286 kB 00:00:00
- (3/14): dhcp-common-4.2.5-82.el7.centos.x86_64.rpm | 176 kB 00:00:00
- (4/14): dhcp-libs-4.2.5-82.el7.centos.x86_64.rpm | 133 kB 00:00:00
- (5/14): plymouth-0.8.9-0.34.20140113.el7.centos.x86_64.rpm | 116 kB 00:00:00
- (6/14): plymouth-core-libs-0.8.9-0.34.20140113.el7.centos.x86_64.rpm | 108 kB 00:00:00
- (7/14): plymouth-scripts-0.8.9-0.34.20140113.el7.centos.x86_64.rpm | 39 kB 00:00:00
- (8/14): python-syspurpose-1.24.42-1.el7.centos.x86_64.rpm | 273 kB 00:00:00
- (9/14): subscription-manager-1.24.42-1.el7.centos.x86_64.rpm | 1.1 MB 00:00:02
- (10/14): subscription-manager-rhsm-1.24.42-1.el7.centos.x86_64.rpm | 331 kB 00:00:00
- (11/14): subscription-manager-rhsm-certificates-1.24.42-1.el7.centos.x86_ | 236 kB 00:00:00
- (12/14): yum-3.4.3-168.el7.centos.noarch.rpm | 1.2 MB 00:00:02
- (13/14): yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm | 34 kB 00:00:00
- (14/14): centos-logos-70.0.6-3.el7.centos.noarch.rpm | 21 MB 00:00:53
- -------------------------------------------------------------------------------------------------
- 总计 483 kB/s | 25 MB 00:00:53
- 从 http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 检索密钥
- 导入 GPG key 0xF4A80EB5:
- 用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
- 指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
- 来自 : http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7
- 是否继续?[y/N]:y
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- 正在更新 : 12:dhcp-libs-4.2.5-82.el7.centos.x86_64 1/27
- 正在更新 : 12:dhcp-common-4.2.5-82.el7.centos.x86_64 2/27
- 正在更新 : yum-3.4.3-168.el7.centos.noarch 3/27
- 正在安装 : yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch 4/27
- 正在更新 : python-syspurpose-1.24.42-1.el7.centos.x86_64 5/27
- 正在更新 : subscription-manager-rhsm-certificates-1.24.42-1.el7.centos.x86_64 6/27
- 正在更新 : subscription-manager-rhsm-1.24.42-1.el7.centos.x86_64 7/27
- 正在安装 : centos-logos-70.0.6-3.el7.centos.noarch 8/27
- 正在更新 : plymouth-core-libs-0.8.9-0.34.20140113.el7.centos.x86_64 9/27
- 正在更新 : plymouth-scripts-0.8.9-0.34.20140113.el7.centos.x86_64 10/27
- 正在更新 : plymouth-0.8.9-0.34.20140113.el7.centos.x86_64 11/27
- 正在更新 : subscription-manager-1.24.42-1.el7.centos.x86_64 12/27
- 正在更新 : 12:dhclient-4.2.5-82.el7.centos.x86_64 13/27
- 正在更新 : basesystem-10.0-7.el7.centos.noarch 14/27
- 清理 : 12:dhclient-4.2.5-82.el7.x86_64 15/27
- 清理 : subscription-manager-1.24.42-1.el7.x86_64 16/27
- 清理 : 12:dhcp-common-4.2.5-82.el7.x86_64 17/27
- 清理 : plymouth-0.8.9-0.34.20140113.el7.x86_64 18/27
- 清理 : plymouth-scripts-0.8.9-0.34.20140113.el7.x86_64 19/27
- 正在删除 : redhat-logos-70.7.0-1.el7.noarch 20/27
- 清理 : 12:dhcp-libs-4.2.5-82.el7.x86_64 21/27
- 清理 : python-syspurpose-1.24.42-1.el7.x86_64 22/27
- 清理 : yum-3.4.3-168.el7.noarch 23/27
- 清理 : basesystem-10.0-7.el7.noarch 24/27
- 清理 : subscription-manager-rhsm-1.24.42-1.el7.x86_64 25/27
- 清理 : subscription-manager-rhsm-certificates-1.24.42-1.el7.x86_64 26/27
- 清理 : plymouth-core-libs-0.8.9-0.34.20140113.el7.x86_64 27/27
- 验证中 : plymouth-core-libs-0.8.9-0.34.20140113.el7.centos.x86_64 1/27
- 验证中 : plymouth-scripts-0.8.9-0.34.20140113.el7.centos.x86_64 2/27
- 验证中 : 12:dhclient-4.2.5-82.el7.centos.x86_64 3/27
- 验证中 : subscription-manager-1.24.42-1.el7.centos.x86_64 4/27
- 验证中 : yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch 5/27
- 验证中 : centos-logos-70.0.6-3.el7.centos.noarch 6/27
- 验证中 : subscription-manager-rhsm-certificates-1.24.42-1.el7.centos.x86_64 7/27
- 验证中 : basesystem-10.0-7.el7.centos.noarch 8/27
- 验证中 : 12:dhcp-common-4.2.5-82.el7.centos.x86_64 9/27
- 验证中 : subscription-manager-rhsm-1.24.42-1.el7.centos.x86_64 10/27
- 验证中 : 12:dhcp-libs-4.2.5-82.el7.centos.x86_64 11/27
- 验证中 : plymouth-0.8.9-0.34.20140113.el7.centos.x86_64 12/27
- 验证中 : yum-3.4.3-168.el7.centos.noarch 13/27
- 验证中 : python-syspurpose-1.24.42-1.el7.centos.x86_64 14/27
- 验证中 : subscription-manager-1.24.42-1.el7.x86_64 15/27
- 验证中 : 12:dhclient-4.2.5-82.el7.x86_64 16/27
- 验证中 : subscription-manager-rhsm-certificates-1.24.42-1.el7.x86_64 17/27
- 验证中 : plymouth-core-libs-0.8.9-0.34.20140113.el7.x86_64 18/27
- 验证中 : plymouth-scripts-0.8.9-0.34.20140113.el7.x86_64 19/27
- 验证中 : yum-3.4.3-168.el7.noarch 20/27
- 验证中 : plymouth-0.8.9-0.34.20140113.el7.x86_64 21/27
- 验证中 : 12:dhcp-libs-4.2.5-82.el7.x86_64 22/27
- 验证中 : subscription-manager-rhsm-1.24.42-1.el7.x86_64 23/27
- 验证中 : 12:dhcp-common-4.2.5-82.el7.x86_64 24/27
- 验证中 : redhat-logos-70.7.0-1.el7.noarch 25/27
- 验证中 : python-syspurpose-1.24.42-1.el7.x86_64 26/27
- 验证中 : basesystem-10.0-7.el7.noarch 27/27
-
- 已安装:
- centos-logos.noarch 0:70.0.6-3.el7.centos
-
- 作为依赖被安装:
- yum-plugin-fastestmirror.noarch 0:1.1.31-54.el7_8
-
- 更新完毕:
- basesystem.noarch 0:10.0-7.el7.centos
- dhclient.x86_64 12:4.2.5-82.el7.centos
- dhcp-common.x86_64 12:4.2.5-82.el7.centos
- dhcp-libs.x86_64 12:4.2.5-82.el7.centos
- plymouth.x86_64 0:0.8.9-0.34.20140113.el7.centos
- plymouth-core-libs.x86_64 0:0.8.9-0.34.20140113.el7.centos
- plymouth-scripts.x86_64 0:0.8.9-0.34.20140113.el7.centos
- python-syspurpose.x86_64 0:1.24.42-1.el7.centos
- subscription-manager.x86_64 0:1.24.42-1.el7.centos
- subscription-manager-rhsm.x86_64 0:1.24.42-1.el7.centos
- subscription-manager-rhsm-certificates.x86_64 0:1.24.42-1.el7.centos
- yum.noarch 0:3.4.3-168.el7.centos
-
- 替代:
- redhat-logos.noarch 0:70.7.0-1.el7
-
- 完毕!
-
-
- 清除yum缓存yum clean all
-
- [root@localhost yum.repos.d]# yum clean all
- 已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager
-
- This system is not registered with an entitlement server. You can use subscription-manager to register.
-
- 正在清理软件源: base
- Other repos take up 36 M of disk space (use --verbose for details)
生成缓存信息,以加速后续的yum操作:yum makecache
- [root@localhost yum.repos.d]# yum makecache
- 已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager
-
- This system is not registered with an entitlement server. You can use subscription-manager to register.
-
- Determining fastest mirrors
- base | 3.6 kB 00:00:00
- (1/4): base/group_gz | 153 kB 00:00:00
- (2/4): base/primary_db | 6.1 MB 00:00:14
- (3/4): base/filelists_db | 7.2 MB 00:00:18
- (4/4): base/other_db | 2.6 MB 00:00:06
- 元数据缓存已建立
- [root@localhost yum.repos.d]# yum repolist all
- 已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager
-
- This system is not registered with an entitlement server. You can use subscription-manager to register.
-
- Loading mirror speeds from cached hostfile
- 源标识 源名称 状态
- base CentOS-$releasever - Base - mirrors.aliyun.com 启用: 10,072
- repolist: 10,072
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。