首页 > 系统相关 >更新CentOS默认yum源为mirrors.aliyun.com

更新CentOS默认yum源为mirrors.aliyun.com

时间:2023-02-21 08:46:07浏览次数:45  
标签:CentOS mirrors 源为 repos repo etc yum aliyun

更新CentOS默认yum源/镜像源为mirrors.aliyun.com

1、首先备份系统自带的yum源配置文件     /etc/yum.repos.d/CentOS-Base.repo

     在进行此类更改时候,先对系统默认源文件进行备份,备份是一个很好的习惯,此处如果权限不够,就使用root权限

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

 

 

2、进入yum源配置文件所在的文件夹

cd /etc/yum.repos.d/

3、下载aliyun的yum源配置文件到/etc/yum.repos.d/

CentOS 7:

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

4、运行yum makecache生成缓存

yum makecache

5、更新系统

yum -y update

标签:CentOS,mirrors,源为,repos,repo,etc,yum,aliyun
From: https://www.cnblogs.com/yaoyaojcy/p/17139639.html

相关文章

  • centos宿主机无法ping通docker容器以及dockers容器curl: (56) Recv failure: Connecti
    今天在测试docker容器时,本来配置的一切都挺顺利,放出我的测试经过:dockerrun-d--namenginx-p8080:80nginx然后这个nginx就在后台启动了,我接着使用命令curl127.......
  • CentOS主机关掉虚拟网卡
    $ipa 1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWNgroupdefaultqlen1000 link/loopback00:00:00:00:00:00brd00:00:00:00:00:00 i......
  • CentOS升级内核
    先下载yum文件https://elrepo.org$wgethttps://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-ml-5.19.0-1.el7.elrepo.x86_64.rpm$wgethttps://elrepo.org/lin......
  • django的部署在centos
    虚拟环境#virtualenv是一个创建独立python环境的工具sudopipinstallvirtualenv#virtualenvwrapper将所有的虚拟环境统一管理,留意安装路径后面要用sudopipinstall......
  • CentOS搭建Yunzai-Bot原神机器人
    Yunzai-Bot是目前使用较多的原神查询机器人,搭建也较为简单。现为Linux用户做一下Yunzai-Bot的搭建教程,这里以CentOS7系统为例。安装Node.js下载地址:https://node......
  • CentOS 7 安装PostgrelSQL-11
    sudoyuminstall-yhttps://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudoyuminstall-ypostgresql11-ser......
  • centos7编译安装python3
    1.安装依赖yum-yinstallzlib-develbzip2-developenssl-develncurses-develsqlite-develreadline-develtk-develgccmakelibffi-devel2.下载软件包wgeth......
  • Centos运行.net core程序的多种方式以及相互之间的区别。
     nohupdotnet/www/wwwroot/xxx.dll--urls"http://*:6001;http://*:6002"&此时候的6001和6002端口对应的程序的内存和static变量都是存在同一个堆栈里面,可以做缓存。......
  • centos6-语言支持
    问题描述在中过绝大多数centos的编码都是(en_US.utf8),极少数情况下是中文编码(zh_CN.utf8zh_TW.utf8)不过还是建议,使用默认的语言编码。问题解决envcentos6.8loca......
  • Centos7系统编译Hadoop3.3.4
    1、背景最近在学习hadoop,此篇文章简单记录一下通过源码来编译hadoop。为什么要重新编译hadoop源码,是因为为了匹配不同操作系统的本地库环境。2、编译源码2.1下载并解压......