首页 > 系统相关 >Linux:RedHat8 更新源

Linux:RedHat8 更新源

时间:2022-12-14 18:00:46浏览次数:82  
标签:centos mirrors os basearch 更新 aliyun Linux com RedHat8

1. 备份原有yum配置文件

# 切换到源文件目录
cd /etc/yum.repos.d/
# 下载阿里云Centos8的源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
# 备份旧的源文件
mv redhat.repo redhat.repo_bak

2. 修改配置文件

# 修改如下两个配置文件, 将enabled的值改为0
vi /etc/yum/pluginconf.d/product-id.conf
vi /etc/yum/pluginconf.d/subscription-manager.conf

3. 新建yum缓存

# 清除yum缓存
yum clean all
# 构建新的yum缓存
yum makecache

完成后查看yum是否可以联到阿里云的源.

4. yum源失败,尝试切换如下源

# 切换到源文件目录
cd /etc/yum.repos.d/

文件1

 这是已经停止维护的8.5-Vault版本的源。

# 创建文件
vi CentOS-Vault.repo
[base]
name=CentOS-8.5.2111 - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-vault/8.5.2111/BaseOS/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.5.2111/BaseOS/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.5.2111/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful

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

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

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

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

 文件2

这是8-stream版本的阿里源。

# 创建文件
vi CentOS-stream-8.repo
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/$basearch/os/
http://mirrors.aliyuncs.com/centos/centos/8-stream/BaseOS/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos/8-stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=https://mirrors.aliyun.com/centos-stream/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/8-stream/extras/$basearch/os/
http://mirrors.aliyun.com/centos/8-stream/extras/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos/8-stream/extras/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/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/8-stream/centosplus/$basearch/os/
http://mirrors.aliyun.com/centos/8-stream/centosplus/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos/8-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

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

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

或者

[base]
name=CentOS-8-stream - Base - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/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-8-stream - Extras - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/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-8-stream - Plus - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-8-stream - PowerTools - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[AppStream]
name=CentOS-8-stream - AppStream - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

 

​https://zhuanlan.zhihu.com/p/464296947​

----------------------------------- 作者:怒吼的萝卜 链接


标签:centos,mirrors,os,basearch,更新,aliyun,Linux,com,RedHat8
From: https://blog.51cto.com/u_12835254/5937989

相关文章

  • [ Linux ] 线程控制(线程创建,等待,终止)
    在上一篇我们了解了Linux下线程的相关概念。而本篇的主要内容是线程控制。线程控制包括线程的创建,线程的终止,线程等待等问题,以及线程分离和Linux常见线程安全问题。1.线程控......
  • linux svn命令
    参考:https://blog.csdn.net/sinolover/article/details/1212445871,拉取到本地svncheckoutsvn://****2,添加svnupdatesvnadd*svncommit-m'x'svnupdates......
  • Linux之pidof命令
    pidof命令用于查找指定名称的进程的进程号id号。语法pidof(选项)(参数)选项-s:仅返回一个进程号;-c:仅显示具有相同“root”目录的进程;-x:显示由脚本开启的进程;......
  • 01.Linux CentOS安装宝塔
    LinuxCentOS安装宝塔什么是宝塔?宝塔是一个安全高效的服务器运维面板,可以直接从宝塔平台上部署web项目、监控服务器资源使用情况、快捷操作文件、一键安装软件及部署源......
  • linux jdk1.8 和maven 安装
    jdk1.8下载链接:https://pan.baidu.com/s/1QDGAbSFZS992ajoruJQBtQ提取码:b3w3jdk安装#解压安装包tarzxvfjdk-8u65-linux-x64.tar.gz#配置环境变量vim/etc/profi......
  • Linux man命令手册使用方法,man和man5区别
    1、https://www.modb.pro/db/4464931.man手册页简介man手册页(manualpages,“手册”),是类UNIX系统最重要的手册工具。多数Linux发行版都预装了它。Linux提供了丰富的帮......
  • linux 安装 ffmpeg
    windows上安装,直接下载压缩包解压。linux安装,找了半天各种技术文章,说最好编译安装,按照步骤安装编译环境编译成功了,但是使用的时候总要安装各种外部库,转码转不了等等问题.........
  • kali linux忘记密码如何重置 在kali上重置密码
    kalilinux忘记密码如何重置|在kali上重置密码忘记了自己的kali密码,不知道怎么修改,找了几篇文章,但是和我自己的情况都有点不同,后面看到了这篇,不光解决了我自己的问题,还学......
  • Linux系统 安装 Redis
    为防止操作权限不足,建议切换root用户,当然如果你对Linux命令熟悉,能够自主完成权限更新操作,可以不考虑此推荐。更多命令学习推荐:Linux安装JDK分为两种:手动安装和yum安装。......
  • IMPDP 在linux 中导入时没有索引 、注释 、主键
    问题描述impdpsystem/orclDIRECTORY=DATA_PUMP_DIRDUMPFILE=HTBA.DMPSCHEMAS=HTBA 这样导入后发现没有表和字段注释,有的索引也没有 解决方案如下显示的加上 inc......