zoukankan      html  css  js  c++  java
  • OS: Redhat8.4 更换网络源的方法

    redhat8.4 更换网络源的方法

     


    一、修改dnf插件配置:(/etc/dnf/plugins)

     

    1、本配置方法,redhat8.4能使用网络源,但无法关闭redhat8.4注册信息提示。在新安装的系统上(rhel-8.4-x86_64-dvd.iso),直接配置dnf相关文件。注意,千万不要卸载和重装dnf等相关软件。



    2.修改 subscription-manager.conf (/etc/dnf/plugins)

    2.1、修改前:
    [root@redhatos plugins]# cat subscription-manager.conf
    [main]
    enabled=1

    # When following option is set to 1, then all repositories defined outside redhat.repo will be disabled
    # every time subscription-manager plugin is triggered by dnf or yum
    disable_system_repos=0

    2.2、修改后(将 "enabled=1" 修改为 "enabled=0" ):
    [root@redhatos plugins]# cat subscription-manager.conf
    [main]
    enabled=0

    # When following option is set to 1, then all repositories defined outside redhat.repo will be disabled
    # every time subscription-manager plugin is triggered by dnf or yum
    disable_system_repos=0


    二、设置 dnf 网络源


    1、网络源内容(网络源文件名 = redhat84-163.repo):


    [root@redhatos config]# cat redhat84-163.repo
    # Redhat.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
    # geographically close to the client. You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #

     


    [BaseOS]
    name=Redhat84 - 163 - Base
    baseurl=https://mirrors.163.com/centos/8-stream/BaseOS/x86_64/os/
    #baseurl=https://mirrors.163.com/centos/8.2.2004/BaseOS/x86_64/os/
    #mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=BaseOS&infra=$infra
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

     


    [AppStream]
    name=Redhat84 - 163 - AppStream
    baseurl=https://mirrors.163.com/centos/8-stream/AppStream/x86_64/os/
    #mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=AppStream&infra=$infra
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

     


    [PowerTools]
    name=Redhat84 - 163 - PowerTools
    baseurl=https://mirrors.163.com/centos/8-stream/PowerTools/x86_64/os/
    #mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=PowerTools&infra=$infra
    enabled=0
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

     


    #additional packages that may be useful
    [extras]
    name=Redhat84 - 163 - Extras
    baseurl=https://mirrors.163.com/centos/8-stream/extras/x86_64/os/
    #mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=extras
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

     


    #additional packages that extend functionality of existing packages
    [centosplus]
    name=Redhat84 - 163 - Plus
    baseurl=https://mirrors.163.com/centos/8-stream/centosplus/x86_64/os/
    #mirrorlist=http://mirrorlist.centos.org/?release=8.2.2004&arch=x86_64&repo=centosplus
    gpgcheck=0
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

    [root@redhatos config]#

     


    2、更换网络源:
    [root@redhatos config]# cp redhat84-163.repo /etc/yum.repos.d/


    3、测试网络源:

    [root@redhatos config]# dnf clean all
    18 files removed
    [root@redhatos config]# dnf makecache
    Redhat84 - 163 - Base 8.5 MB/s | 2.7 MB 00:00
    Redhat84 - 163 - AppStream 18 MB/s | 8.5 MB 00:00
    Redhat84 - 163 - Extras 67 kB/s | 13 kB 00:00
    Last metadata expiration check: 0:00:01 ago on Fri 21 May 2021 04:26:05 PM CST.
    Metadata cache created.
    [root@redhatos config]# dnf grouplist
    Last metadata expiration check: 0:00:12 ago on Fri 21 May 2021 04:26:05 PM CST.
    Available Environment Groups:
    Server with GUI
    Server
    Minimal Install
    Custom Operating System
    Virtualization Host
    Installed Environment Groups:
    Workstation
    Installed Groups:
    Development Tools
    Available Groups:
    Legacy UNIX Compatibility
    Container Management
    .NET Core Development
    Graphical Administration Tools
    Headless Management
    Network Servers
    RPM Development Tools
    Scientific Support
    Security Tools
    Smart Card Support
    System Tools
    [root@redhatos config]#

     


    三、参考资料:

    1、redhat8.0 更改yum源        https://blog.csdn.net/peal1/article/details/114886257

    本文由lnlidawei(https://www.cnblogs.com/lnlidawei)原创或整理,转载请注明出处。
  • 相关阅读:
    python35 1.守护进程 2.互斥锁3.IPC 4.生产者和消费者模型
    python34 多进程: 1.进程与程序的区别 2.阻塞 非阻塞 并行 并发(重点) 3.进程三种方式的切换 4.程序员永恒的话题 5.进程的创建以及销毁 6.进程的两种使用方式(重点) 7.join函数(重点) 8.process常用属性 9僵尸与孤儿进程(了解)
    Python33 1.UDP协议 2.与TCP区别 3.DNS服务器 4.进程----进入并发编程的学习 5.操作系统 6.多道技术
    Mybatis 属性配置
    SqlSessionFactoryBuilder、SqlSessionFactory、SqlSession
    MyBatis 简单入门
    spring mvc 异步 DeferredResult
    Spring MVC 异步请求 Callable
    Servlet 异步处理
    @EnableWebMvc
  • 原文地址:https://www.cnblogs.com/lnlidawei/p/14794454.html
Copyright © 2011-2022 走看看