首页 > 系统相关 >更换CentOS源为中科大源

更换CentOS源为中科大源

时间:2023-07-11 13:44:05浏览次数:39  
标签:中科大 CentOS centos 源为 basearch infra mirrorlist releasever

第一步:

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g'
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g'
-i.bak
/etc/yum.repos.d/CentOS-Base.repo

第二步:

vi /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

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

released updates

[updates]
name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra

baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

additional packages that may be useful

[extras]
name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra

baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

additional packages that extend functionality of existing packages

[centosplus]
name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra

baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

第三步:yum clean all
yum makecache

标签:中科大,CentOS,centos,源为,basearch,infra,mirrorlist,releasever
From: https://www.cnblogs.com/rpbszy/p/17544424.html

相关文章

  • centos7的bond负载均衡(2)
    bond绑定环境:centos7.9,两个网卡添加网卡:添加配置文件件[root@localhostnetwork-scripts]#catifcfg-ens33TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=......
  • CentOS8配置本地yum源
    CentOS8配置本地yum源要切换到root用户下进行以下操作一、创建我们准备要挂载目录mkdir-p/media/cdrom二、将光盘目录挂载到/media/cdrom目录下mount/dev/cdrom/media/cdrom挂载时报错:mount:nomediumfoundon/dev/sr02、解决方法:确保设备状态勾选、使用iso镜像文件用df......
  • centos8双网卡绑定
    Centos8.5绑定网卡(BONDING、TEAM)前置知识Cenos8刷新配好的网络一定要按照底下的顺序nmclicreloadnmclinetworkingoffnmclinetworkingonTeam绑定概述环境:centos8.5,两个网卡(ens33,ens37)查看所有网络连接绑定ens33和ens37,绑定的网卡叫做team-eth0创建team口nmcliconnection......
  • Rockylinux9或Centos8安装zabbix6.0
    zabbix6.0服务端不再支持Centos7的yum安装,Centos8已停止维护,rockylinux是RHEL的下游免费发行版。1.安装rockylinux9:阿里云下载地址#关闭防火墙和selinux并重启sed-i's/SELINUX=enforcing/SELINUX=disabled/'/etc/selinux/configsystemctldisable--nowfirewalld#查......
  • Centos7.9系统docker部署plexServer,打造个人影音服务器
    1.准备工作1.1部署docker安装依赖包yum-yinstallgccgcc-c++yum-utilsdevice-mapper-persistent-datalvm2设置stable镜像仓库yum-config-manager--add-repohttps://download.docker.com/linux/centos/docker-ce.repo或yum-config-manager--add-repohttp://mirrors.al......
  • anolis 8.8 (CentOS 8) 环境下搭建青岛大学OJ
    #yum-yinstallpython3-pip  //systemreplied:Packagepython3-pip-9.0.3-22.an8.noarchisalreadyinstalled.#pipinstalldocker-compose //systemreplied:  bash:pip:commandnotfound...#whereispip //systemreplied:  pip:/usr/bin/pip3.6#cd/u......
  • Anolis 8.8 (CentOS 8) install snapper to support system snapshot.
    Anolis8.8(CentOS8)installsnappertosupportsystemsnapshot.cd/etc/yum.repos.d/wgethttps://download.opensuse.org/repositories/filesystems:snapper/CentOS_8/filesystems:snapper.repoyuminstallsnappersudoyuminstallpython3python3-setuptools......
  • Centos7中禁止root用户远程登录和修改登录端口
    Centos7中禁止root用户远程登录和修改登录端口介绍Linux中root用户权限比较大,被不法人员获知账户和密码后,用root登录后,可以对服务器做任何操作,对服务器危害较大,故需要禁止root用户登录,并且修改登录端口,这样就算root密码泄露,端口不是默认,也无法登录服务器禁止root用户1.修改......
  • centos8的root密码更改
    centos8的root密码更改此界面按e在linux行末尾加入参数rd.break按ctrl+s保存。ctrl+x启动输入mount-orw,remount/sysroot重新挂载sysroot并赋予rw权限输入chroot/sysroot把sysroot修改为/目录通过passwdroot或者echo1|passwd--stdinroottouch/.autorelabel重置SEli......
  • centos7 安装 rabbitmq
    1、下载RabbitMQ安装包(请自行下载erlang和对应版本的rabbitmq)2、上传安装包到Linux中将上面三个软件上传到/usr/local/software目录下(如果没有software需要自己创建)3、安装文件(分别按照以下顺序安装)进入software文件夹,依次使用如下命令 rpm-ivherlang-21.3-1.el7.......