试验linux零碎的时候大家都有一个懊恼,用yum装置的软件包不晓得去哪里了,不像windows那样直观能够将安装包放到一个中央保存起来,接下来为大家介绍yum装置后如果保留rpm包。
yum装置软件之后如何保留rpm安装包yum装置软件之后如何保留rpm安装包
环境:Centos7

办法一
批改/etc/yum.conf将报错字段0改为1
yum装置软件之后如何保留rpm安装包yum装置软件之后如何保留rpm安装包

测试装置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 k

事务概要

装置 1 软件包

总计: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

已装置:
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 ~]# ls
telnet-0.17-65.el7_8.x86_64.rpm
总结
两种办法各有特色,第一种装置不便查找不不便,第二种扭转了习惯的装置命令,然而保留门路很容易查找。