首页 > 系统相关 >Centos7更新yum源

Centos7更新yum源

时间:2022-12-04 21:24:14浏览次数:42  
标签:epel repo CentOS repos 更新 Centos7 Base yum

查看当前的 yum 源

yum repolist

对CentOS-Base.repo进行备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

使用阿里云源替换本地源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

清除yum缓存并更新

yum clean all
yum makecache

安装epel源

yum list | grep epel-release 
yum install -y epel-release

使用阿里开源镜像提供的epel源

wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

再次清除系统yum缓存,并重新生成新的yum缓存

yum clean all
yum makecache

查看新 yum 源

yum repolist enabled
yum repolist all

tips

如果在yum makecache的过程中一直报:
Another app is currently holding the yum lock; waiting for it to exit...
不必慌张,输入以下命令即可

rm -f /var/run/yum.pid

标签:epel,repo,CentOS,repos,更新,Centos7,Base,yum
From: https://www.cnblogs.com/ncphoton/p/16950819.html

相关文章

  • Centos7升级gcc
    不建议贸然升级,时间是比较久的并且容易出现一系列问题。升级GCC版本到11.1GCC11终于发正式版了,4月底官方终于发了11.1正式版.对于我们来说,项目实际使用基于C++17的......
  • Centos7 内核升级(5.4.225)
    目录一、背景二、在线yum安装1)查看当前内核版本信息2)导入仓库源3)选择ML或LT版本安装4)设置启动5)生成grub配置文件6)重启7)验证是否升级成功8)删除旧内核(可选)三、离线rp......
  • 写作计划[持续更新]
    TODOLIST2022-12-14内置对象继续写完,之前写了第一部分python的各种器:描述器、生成器、迭代器、装饰器、上下文管理器[已写]selenium的种种:显式等待、切换等......
  • 更新内容
    '////开始'最新版本=3.0'程序标题=程序更新列子'更新说明=2016-08-02-version:v1.6'更新说明1=1、整理软件架构及源码归档'更新说明2=2、修复已知BUG'更新说......
  • MiniAPI:.NET7 Preview4之MiniAPI更新总览
    一觉醒来,发现微软带来了.NET7Preview4的更新,本次更新关于MiniAPI的还不少,难以掩饰的喜悦心情,促使我尽快把这个消息分享给大家,那下来我们看一下一共带来了哪些关于MiniA......
  • java——mybatis——Mybatis注解开发——@Insert——更新数据——@SelectKey返回自增
    DAO接口:packagecom.sunxl.dao;importcom.sunxl.pojo.User;importorg.apache.ibatis.annotations.Insert;importorg.apache.ibatis.annotations.Select;importo......
  • java——mybatis——Mybatis注解开发——@Insert——更新数据
    pom:<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"......
  • MySQL_03--使用UPDATE根据一个表中的数据条数,更新另一个表的计数字段
    1问题描述1.1两个表的具体内容第一个表:t_user_judge包含:评委id、分配的评分作品数assignNum、完成的评分作品数judgeNum;其他信息字段。第二个表:t_distribute包......
  • centos7安装nginx
    下载解压官网地址:nginx:download下载稳定版中的,Linux版本解压缩tar-zxvfnginx-1.22.1.tar.gz安装依赖yuminstall-yopenssl*&yum-yinstalln......
  • 为 centos7 编译 nginx
    通过yum安装的nginx版本多数是1.22.x,已经被暴露出有一个高危的安全漏洞(CVE-2022-3638)。需要自行编译安装最新的1.23.2以修复这个安全问题。源码好下载,编译命令也简......