zoukankan      html  css  js  c++  java
  • Redhat7 安装 yum源(亲测有效)

    由于之前安装Redhat7 想安装vsftpd  使用yum   install vsftpd 报错:

    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

    大概意思是是让你先注册一下。

    这是redhat 自带的 yum 源需要注册,花钱才能使用,鄙人比较穷,怎么办呢,发现网上说可以替换,于是开始撸,中间也有不少心酸。把心得写下来!!!

     

    第一步:先卸载原来的yum  

     rpm -qa |grep yum    查看原来是否安装

    yum-3.4.3-118.el7.noarch
    yum-utils-1.1.31-24.el7.noarch
    yum-rhn-plugin-2.0.1-4.el7.noarch
    PackageKit-yum-0.8.9-11.el7.x86_64
    yum-langpacks-0.4.2-3.el7.noarch
    yum-metadata-parser-1.1.4-10.el7.x86_64

    直接卸载:

     rpm -qa|grep yum|xargs rpm -e --nodeps

    在次运行  :rpm -qa |grep yum  发现卸载干净了。

     

    第二步 下载 yum 替换包

    这里博主要说明一下,因为要替换,所以一定要是一整套,还有一个rhel-debuginfo.repo文件要配置。部分博客写的就不对了,这个文件配置不对也是不行的,所以博主把测试好的一套yum包给大家包括配置文件。需要留言我。 (最下方有分享链接)

    可以先 mkdir  /home/yum    新建一个文件夹

    把5个安装包拷贝到 yum 这个文件下面

    执行: rpm -ivh *.rpm  一次性执行依赖包,因为包之间会相互依赖。

     

    第三步 新建配置   .repo 文件

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

    输入内容如下:

    #CentOS-Base.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.
    #
    #
    [base]
    name=CentOS-$7 - Base - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
    baseurl=http://mirrors.163.com/centos/7/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


    #released updates
    [updates]
    name=CentOS-$7 - Updates - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
    baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


    #additional packages that may be useful
    [extras]
    name=CentOS-$7 - Extras - 163.com
    #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
    baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7


    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$7 - Plus - 163.com
    baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

    当然你也可以把我的yum 包里面的文件拷贝出来。放到这个文件夹下面 替换成上面的文件名就行。

    第五步  清除缓存

    yum clear all

    然后执行yum makecache清除缓存,就可以看见列表刷新了。

    好了撸完!


    ---------------------------------分割线20210117--------

    应各位要求,现将配置文件分享出。

    链接:https://pan.baidu.com/s/18QPANezXg1kg2pQRNATvaQ
    提取码:5qoe
    ----------------------------------------------------------------

  • 相关阅读:
    Codeforces Round #333 (Div. 1)--B. Lipshitz Sequence 单调栈
    UVALive 7148 LRIP 14年上海区域赛K题 树分治
    UVAlive7141 BombX 14年上海区域赛D题 线段树+离散化
    VK Cup 2015
    Codeforces Round #326 (Div. 1)
    Codeforces Round #216 (Div. 2) E. Valera and Queries 树状数组 离线处理
    Codeforces Round #259 (Div. 2) D. Little Pony and Harmony Chest 状压DP
    Codeforces Round #263 (Div. 1) C. Appleman and a Sheet of Paper 树状数组暴力更新
    java连接mysql出现The server time zone value '�й���׼ʱ��' is unrecognized or represents more than...
    Java Date转Json报错解决方案
  • 原文地址:https://www.cnblogs.com/xiangxiushu/p/12712607.html
Copyright © 2011-2022 走看看