zoukankan      html  css  js  c++  java
  • 【CentOS】更换yum源

    问题的引入:

    默认的CentOS8根本就找不到此软件

    参考清华开源的yum源更换帮助手册:

    https://mirrors.tuna.tsinghua.edu.cn/help/centos/

    CentOS的yum源文件位置

    /etc/yum.repos.d/CentOS-Base.repo

    备份yum源文件

    sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

    编辑 /etc/yum.repos.d/CentOS-Base.repo 文件

    vim /etc/yum.repos.d/CentOS-Base.repo

    1、在 mirrorlist= 开头行前面加 # 注释掉;

    2、并将 baseurl= 开头行取消注释(如果被注释的话)

    3、把该行内的域名(例如mirror.centos.org)替换为 mirrors.tuna.tsinghua.edu.cn

    [BaseOS]
    name=CentOS-$releasever - Base
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
    # baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/$contentdir/$releasever/BaseOS/$basearch/os/

    刷新yum缓存

    sudo yum makecache

    但是这个问题依然无法解决?

    尝试了各种办法,大概就是Yum源中没有这个软件。

    写个鸡儿东西,这还不如手动解压包得了

    所以得出的结论是Tomcat在CentOS8这里不能用yum装

    反手装MySQL居然可以

    其次是第二种方式的还源,这种更为简单

    还是注意要备份源

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

    直接下载源文件到这个目录里面

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-系统版本【5,6,7,8】.repo
    
    或者
    
    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-系统版本【5,6,7,8】.repo

    清除已有的缓存

    yum clean all

    然后再重新加载新缓存

    yum makecache
  • 相关阅读:
    【引用】Android.mk简介
    android02android的四大组件
    rpm 安装指令全
    android04activity的布局管理器
    代码积累1统计图
    清除防火墙所有配置规则
    代码积累2tab页面滑动效果
    RHEL5 配置YUM源 安装RZSZ
    系统安全漏洞扫描软件
    liunx下防火墙的配置
  • 原文地址:https://www.cnblogs.com/mindzone/p/12921212.html
Copyright © 2011-2022 走看看