zoukankan      html  css  js  c++  java
  • yum安装教程

    准备工具

    共享给linux

    共享给linux,自己建一个文件夹/home/yuan/myfile放进去,如下图:

    安装

    按顺序装

    rpm -ivh python-iniparse-0.4-9.el7.noarch -.rpm

    rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64 .rpm

    rpm -ivh --nodeps --force yum-3.4.3-163.el7.centos.noarch.rpm 

    rpm -ivh --nodeps --force yum-plugin-fastestmirror-1.1.31-52.el7.noarch .rpm

    修改镜像

    下一步是修改yum源,首先是切换到这个文件,然后去一个地址下载新的yum.repos.d代替现在的yum.repos.d

    去这里下载:

    wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

    我已经下载好了,接着在linux上找到163的镜像,直接替换当前的yum镜像即可,(任何需要被替换的文件,都要提前备份)。

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

    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://centos.ustc.edu.cn/?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://centos.ustc.edu.cn/?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://centos.ustc.edu.cn/?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

    将原文件修改为成当前文件的内容,将修改文中的&releasever改成你的Centos对应版本号,将源mirrorlist.centos.org改为centos.ustc.edu.cn 。

    当然直接复制我的文件即可。

     

    附加图片一张同上文

     

     

    保存配置

    ECS>:wq!>Enter

    并清理yum缓存

    yum clean all

    生成缓存

    yum makecache

    测试

    yum grouplist

  • 相关阅读:
    使用Systemctl命令来管理系统服务
    使用lsblk命令列出系统中的块设备
    史上最全 | 1000余个实用尽调网站分类汇编
    ​2021年机器学习什么风向?谷歌大神Quoc Le:把注意力放在MLP上
    上手使用 DeepMind 分布式强化学习框架 Acme ,对开发者超友好
    005-ESP32学习开发(SDK)-新建工程补充-通过官方示例创建工程
    Golang 程序中实现优雅关闭 HTTP SERVER
    Golang的time.NewTicker周期性定时器使用案例
    彻底搞懂golang的GOROOT和GOPATH
    微服务之-ServiceMesh
  • 原文地址:https://www.cnblogs.com/timingstarts/p/12556420.html
Copyright © 2011-2022 走看看