zoukankan      html  css  js  c++  java
  • centos yum命令安装并保存rpm安装包

    一、修改yum.conf配置文件参数,打开安装包缓存字段keepcache=1

    [root@localhost yum.repos.d]# vim /etc/yum.conf 
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=1

    二、执行yum 安装命令

    [root@localhost yum.repos.d]# yum install telnet -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.aliyun.com
     * centos-sclo-rh: mirrors.bupt.edu.cn
     * centos-sclo-sclo: mirrors.bupt.edu.cn
     * extras: mirrors.aliyun.com
     * updates: mirrors.aliyun.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package telnet.x86_64 1:0.17-66.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================================================
     Package                    Arch                       Version                            Repository                   Size
    ============================================================================================================================
    Installing:
     telnet                     x86_64                     1:0.17-66.el7                      updates                      64 k
    
    Transaction Summary
    ============================================================================================================================
    Install  1 Package
    
    Total download size: 64 k
    Installed size: 113 k
    Downloading packages:
    telnet-0.17-66.el7.x86_64.rpm                                                                        |  64 kB  00:00:00     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : 1:telnet-0.17-66.el7.x86_64                                                                              1/1 
      Verifying  : 1:telnet-0.17-66.el7.x86_64                                                                              1/1 
    
    Installed:
      telnet.x86_64 1:0.17-66.el7                                                                                               
    
    Complete!
    [root@localhost yum.repos.d]# 

    三、查看缓存的rpm安装包

    [root@localhost /]# cd /var/cache/yum/x86_64/7/updates/packages/
    [root@localhost packages]# ll
    total 68
    -rw-r--r-- 1 root root 65932 Nov 18  2020 telnet-0.17-66.el7.x86_64.rpm
    [root@localhost packages]# 

     如果updates目录下没有就去base目录下的packages下找。

  • 相关阅读:
    Android App Bundle 使用指南
    Homebrew国内源
    Mac下配置环境变量不生效问题
    CocosCreator1.x配置打包Android App Bundle
    Android读取Json文件的工具类
    Cocos Creator 坐标转换
    XCode真机调试不了,提示"Please reconnect the device"
    Canvas: trying to draw too large(134374464bytes) bitmap.
    Modbus主从关系几点记录
    当前时间加上几天
  • 原文地址:https://www.cnblogs.com/sky-cheng/p/15466488.html
Copyright © 2011-2022 走看看