关于linux:yum安装软件之后如何保存rpm安装包

2次阅读

共计 2154 个字符,预计需要花费 6 分钟才能阅读完成。

试验 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
总结
两种办法各有特色,第一种装置不便查找不不便,第二种扭转了习惯的装置命令,然而保留门路很容易查找。

正文完
 0