首页 > 系统相关 >centos 更换yum的镜像源为aliyun

centos 更换yum的镜像源为aliyun

时间:2024-07-10 14:51:49浏览次数:10  
标签:centos CentOS 源为 etc Base yum aliyun releasever

/etc/yum.repos.d/CentOS-Base.repo 是设置具体的镜像源
复制整个命令块,从 cat > 开始,一直到最后的 EOF。

将整个命令块粘贴到终端中。

按 Enter 键。

如果一切正常,命令会自动执行,并创建(或覆盖)文件 /etc/yum.repos.d/CentOS-Base.repo。

命令执行完毕后,你会回到正常的命令提示符。

`
cat > /etc/yum.repos.d/CentOS-Base.repo << 'EOF'

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
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF
`

标签:centos,CentOS,源为,etc,Base,yum,aliyun,releasever
From: https://www.cnblogs.com/zxs-onestar/p/18294051

相关文章

  • CentOS 7:停止更新后如何下载软件?
    引言    CentOS7是一个广受欢迎的Linux发行版,它为企业和开发者提供了一个稳定、安全、且免费的操作系统环境。然而,随着时间的推移,CentOS7的官方支持已经进入了维护阶段,这意味着它将不再收到常规的更新和新功能,只会有极少量的安全补丁和修复。本文将详细介绍Cen......
  • 如何应对红帽不再维护 CentOS
    CentOS(CommunityEnterpriseOperatingSystem,社区企业操作系统)是一种开源的、免费的操作系统。由LanceDavis发起,通过社区驱动,目标是创建一个免费的企业级操作系统。它根据RedHatEnterpriseLinux(RHEL)开放源码编译而成,由于代码相同,因此一些要求高度稳定性的服务器使用CentO......
  • CentOs去除桌面上边栏、隐藏桌面图标、修改桌面背景
    1:去除CentOs桌面上边栏:  修改/usr/share/gnome-shell/theme目录下gnome-classic.css                 修改/usr/share/gnome-shell/modes/目录下classic.json2:隐藏桌面图标:应用程序-》工具-》优化工具-》桌面,取消勾选的图标3:去除下边栏:cd /usr/......
  • 2.1 yum 安装 jenkins
    yum安装jenkins官方文档:https://pkg.jenkins.io/redhat-stable/http://mirrors.jenkins-ci.org/openinnewwindow可选择Jenkins长期支持版本或Jenkins每周版本进行安装。长期支持版本每12周从定期发布流中选择一个LTS(长期支持)openinnewwindow发布作为该时间段的稳定发......
  • 在openEuler 22.03上使用yum安装PostgreSQL单机环境
    环境申请由于环境要国产化,选择openEuler22.03LTS系统,这里测试一下在openEuler上安装PG,过程如下。代码语言:javascript复制dockerrm-flhropeneuler22dockerrun-itd--namelhropeneuler22-hlhropeneuler22\-p15432:5432-p7389:3389\--privileged=true......
  • linux centos8升级openssh与openssl
    LinuxOpenSSH升级升级openssh之前需要先升级openssl 1、升级准备##1.1、查看系统版本和ssh版本linux系统版本cat/etc/redhat-release#或者uname-aopenssh查看一下原安装版本ssh-Vopenssl查看一下原安装版本opensslversion 1.2、下载软件包Opens......
  • 搭建本地yum源
    一、环境准备1.准备2-3台虚拟机,一台为服务端(安装yum源),其余的为客户端(测试yum源安装结果),最好是同网段的。IP地址角色备注192.168.116.5服务端将完整镜像上传到这台机器192.168.116.15客户端192.168.116.25客户端2.准备镜像文件,这里以CentOS-7-x86_64-2009,当然最好是使用CentO......
  • 在CentOS 7虚拟机上正确安装Redis
    在CentOS7虚拟机上正确安装Redis,可以按照以下步骤进行操作:更新系统软件包:sudoyumupdate安装Redis依赖库:sudoyuminstallepel-releaseyum-utilssudoyuminstallhttp://rpms.remirepo.net/enterprise/remi-release-7.rpmsudoyum-config-manager--enableremisudoyu......
  • Centos7防火墙firewalld基本配置与端口转发
    1.firewalld基本介绍    Centos7开始已经放弃iptables,转而使用firewalld。从本质意义上讲,iptables和firewalld是防火墙软件,其实现方式都是调用内核Netfilter。firewalld提供了一个动态管理的防火墙,形成网络“zones”规则集,具备支持ipv4和ipv6的能力。firewalld程序提供了......
  • CentOS7云服务器环境搭建
    一、下载、更新依赖1、更新系统版本至7.9yumupdate2、下载Vimyuminstallvim-y3、下载gcc(C语言环境,redis依赖它)yuminstallgcc软件统一安装在/usr/local/software目录下,源码统一解压缩在/usr/local/source二、Java参考:CSDN1、下载java1.8_202压缩包wgethtt......