rhel-server-7.0 更改yum源

1.检查是否安装yum软件包.

[[email protected] ~]# rpm -qa |grep yum

yum-utils-1.1.31-24.el7.noarch

yum-langpacks-0.4.2-3.el7.noarch

yum-metadata-parser-1.1.4-10.el7.x86_64

yum-rhn-plugin-2.0.1-4.el7.noarch

PackageKit-yum-0.8.9-11.el7.x86_64

yum-3.4.3-118.el7.noarch

2.删除RedHat自带yum软件包.

[[email protected] ~]#  rpm -qa | grep yum | xargs rpm -e --nodeps

[[email protected] ~]#  rpm -qa | grep yum

3.下载yum软件包,使用CentOS 7的yum软件包.

使用阿里云地址下载

[[email protected] ~]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metada ta-parser-1.1.4-10.el7.x86_64.rpm

[[email protected] ~]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3- 150.el7.centos.noarch.rpm

[[email protected] ~]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin -fastestmirror-1.1.31-40.el7.noarch.rpm

[[email protected] ~]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils- 1.1.31-40.el7.noarch.rpm

[[email protected] ~]# wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-url grabber-3.10-8.el7.noarch.rpm

(rpm -qa|grep python-urlgrabber|xargs rpm -e --nodeps )



或使用163地址下载

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-125.el7.centos.noarch.rpm

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-29.el7.noarch.rpm

4.安装Yum软件包.

注意:单独安装包可能会产生依赖包(如yum和yum-fastestmirror会相互依赖)

[[email protected] ~]# rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm

[[email protected] ~]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-3.4.3-150.el7 .centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

5.更换Yum源,使用阿里云或163的Yum源.

5.1 备份原镜像文件

5.2 下载CentOS7-Base.repo到/etc/yum.repos.d/

[[email protected] ~]# wget -O /etc/yum.repos.d/CentOS7-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.re po

5.3 修改CentOS-Base.repo文件中的$releasever全部替换为版本号7. 或下载下面文件上传至/etc/yum.repos.d 目录.

5.4 运行 yum makecache 生成缓存.

[[email protected] ~]# yum clean all

[[email protected] ~]# yum makecache

[[email protected] ~]# yum update

[[email protected] ~]# yum repolist

时间: 2024-08-02 22:02:43

rhel-server-7.0 更改yum源的相关文章

更改yum源及pip源

CentOS更改yum源为阿里 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/ CentOS 5 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo 或者 curl -o /e

在CentOS 7下更改yum源与更新系统

在CentOS 7下更改yum源与更新系统. [1] 首先备份/etc/yum.repos.d/CentOS-Base.repo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup [2] 进入yum源配置文件所在文件夹 cd /etc/yum.repos.d/ [3] 下载163的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份) wget http://mir

CentOS 7更改yum源与更新系统

在CentOS 7下更改yum源与更新系统. [1] 首先备份/etc/yum.repos.d/CentOS-Base.repo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup [2] 进入yum源配置文件所在文件夹 [[email protected] yum.repos.d]# cd /etc/yum.repos.d/ [3] 下载163的yum源配置文件,放入/etc/yum.rep

redhat更改yum源及安装PHP环境

redhat更新yum源 删除同RHEL一同安装的yum源 rpm -qa|grep yum #查看本地yum yum list | wc -l #看个数 yum install pip #看现象 rpm -qa|grep yum|xargs rpm -e --nodeps #卸载本地yum,不检查依赖性,卸载yum程序 重装yum资料来源: https://blog.51cto.com/xiaocao13140/2131856 给了3个 python-urlgrabber-3.9.1-11.e

RedHat7.5 针对This system is not registered with an entitlement server问题,更换yum源

1.报错现象如下:[[email protected] ~]# yum install httpd已加载插件:langpacks, product-id, search-disabled-repos, subscription- : managerThis system is not registered with an entitlement server. You can use subscription-manager to register.There are no enabled re

Centos 更改yum源

Centos 的yum源的配置路径,主要是在/etc/yum.repos.d/CentOS-Base.repo 的文件,在进行更改的时候,要注意先安装wget ,本案例中,使用的是阿里云的yum源,详情文档可以参考: https://yq.aliyun.com/articles/33286 步骤如下: 1. 先安装wget 工具,为下面下载阿里云的yum源的配置文件做准备 2. 备份Yum 源的源文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.r

更改yum源为阿里云的yum源

更改centos6的yum源为阿里云的yum源 方法: 1.进入到/etc/yum.repos.d/目录下,备份之前的CentOS-Base.repo地址. cd /etc/yum.repos.d/ mv CentOS-Base.repo CentOS-Base.repo.bak 2.下载阿里云yum源 centos6:wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo centot5:wget -O Cen

访问不了国外安装不了软件需要更改yum源与更新系统 (CentOS6为例)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup    #备份原文件 cd /etc/yum.repos.d/                                                       #进入yum源配置文件所在文件夹 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo           #下载1

CentOS更改yum源与更新系统

[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup [2] 进入yum源配置文件所在文件夹 [[email protected] yum.repos.d]# cd /etc/yum.repos.d/ [3] 下载163的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份) [[ema