[Practical skills] rpm package download and install. Get rpm resources

1. rpm package download

When we use yum installthe command, we usually download it and install it directly, but what if we only want to download the rpm package without installing it?

  1. Install yum-utils
yum install yum-utils -y
  1. Check out the commands in the yum-utils package
rpm -ql yum-utils
rpm -ql yum-utils |grep yumdownloader
  1. Download using yumdownloader
yumdownloader --resolve <软件名称>

2. rpm package installation

Install

rpm -ivh --force --nodeps <rpm包名>

--force --nodeps : Force installation regardless of dependencies

View rpm packages

rpm -qa #查看所有
rpm -qa |grep telnet #查看带有telnet的rpm包

delete rpm package

rpm -e <rpm包名>

insert image description here

upgrade rpm package

rpm -Uvh <rpm包名>  # 升级
rpm -Fvh <rpm包名>  # 升级

insert image description here

3. Common parameters of rpm

 # 安装
 rpm -ivh <rpm包名>				# 直接安装
 rpm --force -ivh <rpm包名> 		# 忽略报错,强制安装
 rpm -ivh --noscripts <rpm包名> 	# 在安装过程不执行脚本
 rpm -ivh --replacepkgs <rpm包名> # 覆盖、替换安装
 
 # 在安装过程可能出现以来错误,如A包依赖于B包,那么在A包安装之前,需要先安装好B包
 
 # 查询
 rpm -q telnet				# 查询指定的包是否安装
 rpm -qa					# 列出所有安装过的包
 rpm -qf  /bin/ls			# 查询指定文件来自于那个安装包
 rpm -qif /bin/ls   		# 返回软件包的有关信息
 rpm -qlf /bin/ls   		# 返回软件包的文件列表
 rpm -qi telnet				# 查询包元数据
 rpm -ql telnet				# 获取rpm包中的文件安装的位置
 rpm -qd telnet				# 查询包相关文档
 rpm -qc bash				# 查询包配置文件
 rpm -q --scripts bash		# 查询安装、卸载前后执行的脚本
 rpm -q --changelog telnet 	# 查询包更新信息
 rpm -qpR <rpm包名>     	 # 查看包依赖关系

4. Summary

This scenario is especially suitable for the use of the intranet. When we need an installation package, the intranet cannot be downloaded. We can download it using the extranet first, and then copy it to the intranet for installation.

rpm package resource website: http://rpm.pbone.net/

The WeChat public account has been opened first. You can find me by searching for "Jiang Xiaonan and his friends". Friends, you can pay attention. The article will be updated synchronously for easy viewing.

Guess you like

Origin blog.csdn.net/weixin_45842494/article/details/123453225