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
  • 相关阅读:
    数据库表结构变动发邮件脚本
    .net程序打包部署
    无法登陆GitHub解决方法
    netbeans 打包生成 jar
    第一次值班
    RHEL6 纯命令行文本界面下安装桌面
    C语言中格式化输出,四舍五入类型问题
    I'm up to my ears
    How to boot ubuntu in text mode instead of graphical(X) mode
    the IP routing table under linux@school
  • 原文地址:https://www.cnblogs.com/mindzone/p/12921212.html
Copyright © 2011-2022 走看看