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
  • 相关阅读:
    CS academy Binary Flips(dp)
    [POJ 1637] Sightseeing tour(网络流)
    Codeforces 346D Robot Control(01BFS)
    BZOJ 2069: [POI2004]ZAW(Dijkstra + 二进制拆分)
    驱动之SPI,UART,I2C的介绍与应用20170118
    USB驱动之CDC类的介绍与应用20160905
    uCOS-II之移植20160823
    java之面向对象20160818
    Java之基础20160806
    Android之框架20160721
  • 原文地址:https://www.cnblogs.com/mindzone/p/12921212.html
Copyright © 2011-2022 走看看