yum下载rpm安装包
安装包带依赖
将curl下载到单前目录
yum install --downloadonly --downloaddir=./ curl
下载到绝对路径目录
yum install --downloadonly --downloaddir=/tmp curl
例子
[root@docker226 pptpd]# yum install --downloadonly --downloaddir=./ curl
[root@docker226 pptpd]# ll
-rw-r--r--. 1 root root 275400 11月 12 2018 curl-7.29.0-51.el7.x86_64.rpm
-rw-r--r--. 1 root root 226772 11月 12 2018 libcurl-7.29.0-51.el7.x86_64.rpm
如何使用yum来下载RPM包而不进行安装 https://www.cnblogs.com/wangmo/p/7205528.html
yumdownloader 下载
# --resolve 下载依赖包
yumdownloader --destdir=/opt/temp --resolve nginx
# 去除 --resolve 紧下载安装包
yumdownloader --destdir=/opt/temp --resolve nginx
安装
# 安装 rpm 包
rpm -ivh xxx.rpm
# 装当前目录下所有rpm包
rpm -ivh *.rpm
# 强制安装,不验证依赖包
# --nodeps do not verify package dependencies
# --force short hand for --replacepkgs --replacefiles
rpm -ivh *.rpm --force --nodeps
查看yum库
[root@localhost temp]# yum repolist
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* epel: mirrors.tuna.tsinghua.edu.cn
repo id repo name status
base/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,796
extras/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 526
!rabbitmq_rabbitmq-server/x86_64 rabbitmq_rabbitmq-server 98
!rabbitmq_rabbitmq-server-source rabbitmq_rabbitmq-server-source 0
updates/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 5,886
repolist: 30,378