美文网首页
redhat7.5更改yum源

redhat7.5更改yum源

作者: 软件测试笔记 | 来源:发表于2020-01-16 16:50 被阅读0次

背景:redhat7.5的yum服务是付费的,就无法愉快的使用yum安装软件,所以采取了替换为CentOs的yum工具

1.登录redhat查看yum

rpm -qa |grep yum

2.卸载yum

rpm -qa | grep yum | xargs rpm -e --nodeps

3.下载安装centos7的yum依赖

http://mirrors.163.com/centos/7/os/x86_64/Packages/

从上边的地址下载如下包,然后安装 rpm -ivh yum-* python-*

rpm -ivh yum-* 如果报错

选择一起安装, rpm -ivh  依赖的安装包  依赖的安装包1

检查是否安装成功 rpm -qa | grep yum 

4.新建repo 配置文件

vim /etc/yum.repos.d/CentOS-Base.repo

文件内容如下:

#CentOS-Base.repo 

# The mirror system uses the connecting IP address of the client and the 

# update status of each mirror to pick mirrors that are updated to and 

# geographically close to the client. You should use this for CentOS updates 

# unless you are manually picking other mirrors. 

# If the mirrorlist= does not work for you, as a fall back you can try the 

# remarked out baseurl= line instead. 

[base] 

name=CentOS-$7 - Base - 163.com 

#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=7&arch=basearch&repo=os 

baseurl=http://mirrors.163.com/centos/7/os/$basearch/ 

gpgcheck=1 

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates 

[updates] 

name=CentOS-$7 - Updates - 163.com 

#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=7&arch=basearch&repo=updates 

baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ 

gpgcheck=1 

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful 

[extras] 

name=CentOS-$7 - Extras - 163.com 

#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=7&arch=basearch&repo=extras 

baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ 

gpgcheck=1 

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages 

[centosplus] 

name=CentOS-$7 - Plus - 163.com 

baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ 

gpgcheck=1 

enabled=0 

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

5.清除缓存:

yum clean all 

6.测试下yum是否可用

安装个wget试试,安装成功即可

以上~

相关文章

  • redhat7.5更改yum源

    背景:redhat7.5的yum服务是付费的,就无法愉快的使用yum安装软件,所以采取了替换为CentOs的yum...

  • 更改yum源

    cd /etc/yum.repos.d/

  • Linux升级PHP版本

    由于linux的yum源不存在php7.x,所以我们要更改yum源: 使用yum search php7检查yum...

  • 安装完CentOS 7 后必做事——软件安装(lnmp)

    yum源更改 备份mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.re...

  • CentOS 更改yum源

    阿里yum源 阿里云yum官网说明 1、备份 mv /etc/yum.repos.d/CentOS-Base.re...

  • CentOS更改yum源

    1.备份现有的源 2.设置新的yun目录 3.安装wget 4.根据系统版本选择镜像源 5.清除文件并重建元数据缓...

  • CentOS更改yum源

    1、打开文件夹 2、下载repo文件 3、备份原来的repo文件 4、用下载repo文件替换原来的repo文件 5...

  • 阿里云PHP+Mysql

    PHP 1、由于linux的yum源不存在php7.x,所以我们要更改yum源: 2、yum查询安装php71w ...

  • centos 更改yum源为阿里yum源

    CentOS 1.备份 2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/ Cen...

  • Ⅲ.rpm&yum

    yum作用 自动下载RPM包并且安装,可自动处理依赖关系 yum 语法 yum常用命令 更改yum_BASE源 注...

网友评论

      本文标题:redhat7.5更改yum源

      本文链接:https://www.haomeiwen.com/subject/qsofzctx.html