yum安装软件以后如何保存rpm安装包

实验linux系统的时候你们都有一个烦恼,用yum安装的软件包不知道去哪里了,不像windows那样直观能够将安装包放到一个地方保存起来,接下来为你们介绍yum安装后若是保存rpm包。
yum安装软件以后如何保存rpm安装包yum安装软件以后如何保存rpm安装包
环境:Centos7linux

方法一
修改/etc/yum.conf将报错字段0改成1
yum安装软件以后如何保存rpm安装包yum安装软件以后如何保存rpm安装包windows

测试安装telnet
[root@localhost packages]# yum install telnet -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile架构

  • base: mirrors.aliyun.com
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com

正在解决依赖关系
--> 正在检查事务
---> 软件包 telnet.x86_64.1.0.17-65.el7_8 将被 安装
--> 解决依赖关系完成测试

依赖关系解决插件

===============================================================================================事务

Package 架构 版本 源 大小

正在安装:
telnet x86_64 1:0.17-65.el7_8 updates 64 kio

事务概要

安装 1 软件包ast

总计:64 k
安装大小:113 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : 1:telnet-0.17-65.el7_8.x86_64 1/1
验证中 : 1:telnet-0.17-65.el7_8.x86_64 1/1 test

已安装:
telnet.x86_64 1:0.17-65.el7_8 软件

完毕!
查看安装包所在位置
须要根据安装的时候提示的源的位置进行查找,通常会有base epel,extras,updates这几个类型,本次安装显示源是updates因此去updates目录下寻找。

[root@localhost packages]# ls
telnet-0.17-65.el7_8.x86_64.rpm
[root@localhost packages]# pwd
/var/cache/yum/x86_64/7/updates/packages
[root@localhost packages]#
方法二
安装yum-utils软件来达到保持目的

[root@localhost ~]# yum install yum-utils -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.aliyun.com
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com

正在解决依赖关系
--> 正在检查事务
---> 软件包 yum-utils.noarch.0.1.1.31-54.el7_8 将被 安装
--> 解决依赖关系完成

依赖关系解决

========================================================================================================================================

Package 架构 版本 源 大小

正在安装:
yum-utils noarch 1.1.31-54.el7_8 updates 122 k

事务概要

安装 1 软件包

总计:122 k
安装大小:337 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : yum-utils-1.1.31-54.el7_8.noarch 1/1
验证中 : yum-utils-1.1.31-54.el7_8.noarch 1/1

已安装:
yum-utils.noarch 0:1.1.31-54.el7_8

完毕!
[root@localhost ~]#
测试安装telnet
--destdir指定目录, 最后面指定须要安装的包名

[root@localhost ~]# yumdownloader --destdir=/root telnet
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.aliyun.com
  • extras: mirrors.aliyun.com
  • updates: mirrors.aliyun.com

[root@localhost ~]# lstelnet-0.17-65.el7_8.x86_64.rpm总结两种方法各有特点,第一种安装方便查找不方便,第二种改变了习惯的安装命令,可是保存路径很容易查找。