首页 > 系统相关 >Linux(Centos7)更换为阿里yum源

Linux(Centos7)更换为阿里yum源

时间:2024-09-18 11:22:43浏览次数:3  
标签:http centos mirrors Centos7 yum aliyun Linux releasever com


1、替换Centos-Base.repo

(1)备份
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
(2)更换为阿里yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

或手动创建编辑文件:/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-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

2、安装基本工具

yum install -y gcc gcc-c++ make cmake wget lrzsz perl crontabs patch net-tools unzip zlib zlib-devel pcre pcre-devel libxml2 libxml2-devel bzip2-devel libcurl-devel ncurses ncurses-devel openssl openssl-devel telnet


标签:http,centos,mirrors,Centos7,yum,aliyun,Linux,releasever,com
From: https://blog.51cto.com/ohxiaohu/12044622

相关文章

  • Linux内核源码介绍-贡献Linux内核社区
    建议点击这里查看个人主页上的最新原文作者:陈孝松主页:chenxiaosong.com哔哩哔哩:陈孝松课程:chenxiaosong.com/courses博客:chenxiaosong.com/blog贡献:chenxiaosong.com/contributions邮箱:[email protected]交流群:544216206,点击查看群介绍点......
  • Linux下eCal测试计划及进度记录
    完整的源代码包:#安装依赖sudoapt-getinstallgitcmakedoxygengraphvizbuild-essentialzlib1g-devsudoapt-getinstalllibhdf5-devlibprotobuf-devlibprotoc-devprotobuf-compilersudoapt-getinstalllibcurl4-openssl-devlibqwt-qt5-devlibyaml-cpp-dev......
  • 初学者学好linux的方法二
    Linux操作系统启动流程:初学者对Linux操作系统启动流程的理解,能有助于后期在企业中更好的维护Linux服务器,能快速定位系统问题,进而解决问题。Linux操作系统启动流程如图3-4所示:图3-4系统启动流程(1) 加载BIOS计算机电源加电质检,首先加载基本输入输出系统(BasicInputOutputSystem,BIO......
  • Linux内核中cpu_capacity是什么?
    cpu_capacity在Linux内核中,cpu_capacity是用于表示每个CPU的处理能力的一个参数,通常用于调度器的负载均衡。它表明不同的CPU核心在计算资源分配中的相对性能,尤其在异构多核架构(如ARM的big.LITTLE架构)中,不同的核心可能具有不同的计算能力。主要概念同构和异构架构:在同构架......
  • CSP初赛知识点:Linux 系统
    CSP初赛知识点:Linux系统前言近年CSP初赛几乎前5道选择题都有一两道有关Linux系统的使用,所以作为备战CSP-J/S2024的资料,整理下来啦。祝各位今年所有考试都能考出自己满意的成绩!1、常用文件操作命令以下设文件名均为csp,需要复制或修改成的文件名均为rp。功能......
  • Linux基础3-基础工具4(git,冯诺依曼计算机体系结构)
    上篇文章:Linux基础3-基础工具3(make,makefile,gdb详解)-CSDN博客本章重点:1.git简易使用2.冯诺依曼计算机体系结构介绍一.git使用 1.1什么是git?    git是用于管理代码版本的一种工具,我们在如GitHub,Gitee中创立自己的仓库后。        我们在本地使......
  • linux驱动开发-内核并发 poll 和 lock
    内核并发poll加lock执行流程用户空间进程调用write将数据写入设备:执行char_write,更新event_triggered并唤醒等待的进程。有进程因此等待:正在执行的char_read会检查event_triggered,如果为0,执行等待。数据可用时:事件被触发(event_triggered被设为1),之前因等待而被......
  • linux驱动开发-内核异步通知
    驱动/内核异步通知在Linux驱动程序中,异步通知机制允许内核模块在特定事件发生时主动通知用户空间进程。这样的设计通常用于管理输入输出操作,确保用户程序可以及时获得数据或状态变化而无需频繁查询设备状态。在Linux驱动中,常见的异步通知机制主要有以下几种:信号(Sign......
  • linux用户管理基本命令
    目录禁止非root用户连接配置文件/etc/group/etc/gshadow/etc/passwd/etc/shadow用户组管理groupaddgroupmodgroupdel用户管理useraddusermoduserdelpasswd主要组和附属组gpasswdnewgrpsuidgroups禁止非root用户连接在etc目录下创建nologin的空文件即可touch/etc/nologin配置......
  • 【Linux 20】线程控制
    文章目录......