centos8 配置阿里源

CentOS 8更改了安装程序,改而使用了dnf 作为安装程序。虽然新增了软件包的安装方式,但是 yum命令还是可以正常使用。
centos8 配置阿里源

    1、备份CentOS-Base.repo文件
    cd /etc/yum.repos.d
    cp CentOS-Base.repo CentOS-Base.repo.bak
    2、配置文件vim tOS- 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
    #eographically close to the client.  You should use this for CentOS updates
    #nless you are manually picking other mirrors.

    [base]
    name=CentOS-$releasever - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that extend functionality of existing packages
[centosplus]
    name=CentOS-$releasever - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
    gpgcheck=1
    enabled=0
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

    [PowerTools]
    name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
    gpgcheck=1
    enabled=0
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

    [AppStream]
    name=CentOS-$releasever - AppStream - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

    [centosplus]
    name=CentOS-$releasever - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
    http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
    http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
    gpgcheck=1
    enabled=0
    gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

最后执行命令:

    dnf clean all # 清除所有的缓存文件
    dnf makecache # 制作元数据缓存

原文地址:https://blog.51cto.com/11353391/2486246

时间: 2024-11-09 03:38:42

centos8 配置阿里源的相关文章

简单快速配置Centos7配置阿里源

进入yum源所在文件路径 cd /etc/yum.repos.d/ 2.用wget命令下载repo文件 wget http://mirrors.aliyun.com/repo/Centos-7.repo 3.若没有wget命令,则要安装wget命令 yum install -y wget 4.当前目录是/etc/yum.repos.d,所以刚刚下载的Centos-7.repo也在这个目录上5.备份原来的repo文件 mv CentOS-Base.repo CentOS-Base.repo_bak

mybaits的 maven pom.xml文件中配置阿里源

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http

maven settings.xml 配置 --阿里源

1 <?xml version="1.0" encoding="UTF-8"?> 2 3 <!-- 4 Licensed to the Apache Software Foundation (ASF) under one 5 or more contributor license agreements. See the NOTICE file 6 distributed with this work for additional informati

Ubuntu18.04 apt配置阿里源

lichengbei 2019-12-21 先备份 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 修改配置文件 sudo vim /etc/apt/sources.list deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic

ubuntu 配置阿里源

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restrict

docker配置阿里源

sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://x9o4p9lt.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker 原文地址:https://www.cnblogs.com/Stiv

CentOS配置本地yum源/阿里云yum源/163yuan源,并配置yum源的优先级

一.用Centos镜像搭建本地yum源 由于安装centos后的默认yum源为centos的官方地址,所以在国内使用很慢甚至无法访问,所以一般的做法都是把默认的yum源替换成aliyun的yum源或者163等国内的yum源(下文介绍如何配置). 但是以上的方法都是需要网络的,当没有网络的时候就无法使用了,所以还有一个常用的方法就是用Centos的iso镜像搭建本地yum源,这样安装软件的速度就会飞快,缺点是可能有些包没有. 1.安装Centos后默认的yum源如下 [[email protect

redhat7配置阿里云的yum源并安装httpd服务 &nbsp;

1.配置yum源 [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/ gpgcheck=1 enabled=1 gpgkey=http://mirrors.aliyun.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 2.更新yum源 y

Centos7.4配置本地yum源和阿里源并配置yum优先级

一.用Centos镜像搭建本地yum源 安装完linux系统的默认yum源为centos的官方地址,在"国内的特殊环境"下使用很慢甚至无法访问,所以一般的做法都是把默认的yum源替换成aliyun的yum源或者163等国内的yum源.但是以上的方法都是需要网络的,当没有网络的时候就无法使用了,所以还有一个常用的方法就是用Centos的iso镜像搭建本地yum源,这样安装软件的速度就会飞快,缺点是可能有些需要的包文件本地里没有. ? ?# 1.安装Centos后默认的yum源如下 [[e