【CentOS 7笔记27】,三种方法安装软件包之rpm安装#171110

hellopasswd


安装软件包的三种方法

  • rpm工具
  • yum工具
  • 源码包
[root@localhost ~]# mount /dev/cdrom /mnt
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# ls
	CentOS_BuildTag  EULA  images    LiveOS    repodata              RPM-GPG-KEY-CentOS-Testing-7
	EFI              GPL   isolinux  Packages  RPM-GPG-KEY-CentOS-7  TRANS.TBL
[root@localhost mnt]# cd Packages/
[root@localhost Packages]# ls
	#本地所有rpm包

rpm包格式:

包名-主版本号.次版本号.修正版本号-发布版本号-平台.rpm

常见的rpm工具使用方式

rpm -ivh zsh-*.rpm #安装可视化

rpm -Uxh zsh-*.rpm #升级可视化

rpm -qa #查询所有包

rpm -e 包名 #需安装先依赖包

[root@localhost Packages]# rpm -e ppp
	error: Failed dependencies:
		ppp = 2.4.5 is needed by (installed) NetworkManager-1:0.9.9.1-13.git20140326.4dba720.el7.x86_64
[root@localhost Packages]# rpm -e NetworkManager
	error: Failed dependencies:
		NetworkManager(x86-64) = 1:0.9.9.1-13.git20140326.4dba720.el7 is needed by (installed) NetworkManager-tui-1:0.9.9.1-13.git20140326.4dba720.el7.x86_64

rpm -q 包名 #查询是否安装

[root@localhost Packages]# rpm -q wget
	wget-1.14-15.el7_4.1.x86_64
[root@localhost Packages]# rpm -q vim
	package vim is not installed

rpm -qi 包名 #查询包信息

[root@localhost Packages]# rpm -qi wget
	Name        : wget
	Version     : 1.14
	Release     : 15.el7_4.1
	Architecture: x86_64
	Install Date: Tue 14 Nov 2017 05:59:46 AM CST
	Group       : Applications/Internet
	Size        : 2055533
	License     : GPLv3+
	Signature   : RSA/SHA256, Fri 27 Oct 2017 01:54:42 AM CST, Key ID 24c6a8a7f4a80eb5
	Source RPM  : wget-1.14-15.el7_4.1.src.rpm
	Build Date  : Fri 27 Oct 2017 12:50:51 AM CST
	Build Host  : c1bm.rdu2.centos.org
	Relocations : (not relocatable)
	Packager    : CentOS BuildSystem <http://bugs.centos.org>
	Vendor      : CentOS
	URL         : http://www.gnu.org/software/wget/
	Summary     : A utility for retrieving files using the HTTP or FTP protocols
	Description :
	GNU Wget is a file retrieval utility which can use either the HTTP or
	FTP protocols. Wget features include the ability to work in the
	background while you are logged out, recursive retrieval of
	directories, file name wildcard matching, remote file timestamp
	storage and comparison, use of Rest with FTP servers and Range with
	HTTP servers to retrieve files over slow or unstable connections,
	support for Proxy servers, and configurability.

rpm -ql 包名 #查询包会安装什么文件

[root@localhost Packages]# rpm -ql wget
	/etc/wgetrc
	/usr/bin/wget
	/usr/share/doc/wget-1.14
	/usr/share/doc/wget-1.14/AUTHORS
	/usr/share/doc/wget-1.14/COPYING
	/usr/share/doc/wget-1.14/MAILING-LIST
	/usr/share/doc/wget-1.14/NEWS
	/usr/share/doc/wget-1.14/README
	/usr/share/doc/wget-1.14/sample.wgetrc
	/usr/share/info/wget.info.gz
	/usr/share/locale/be/LC_MESSAGES/wget.mo
	/usr/share/locale/bg/LC_MESSAGES/wget.mo
	/usr/share/locale/ca/LC_MESSAGES/wget.mo
	/usr/share/locale/cs/LC_MESSAGES/wget.mo
	/usr/share/locale/da/LC_MESSAGES/wget.mo
	/usr/share/locale/de/LC_MESSAGES/wget.mo
	/usr/share/locale/el/LC_MESSAGES/wget.mo
	/usr/share/locale/en_GB/LC_MESSAGES/wget.mo
	/usr/share/locale/eo/LC_MESSAGES/wget.mo
	/usr/share/locale/es/LC_MESSAGES/wget.mo
	/usr/share/locale/et/LC_MESSAGES/wget.mo
	/usr/share/locale/eu/LC_MESSAGES/wget.mo
	/usr/share/locale/fi/LC_MESSAGES/wget.mo
	/usr/share/locale/fr/LC_MESSAGES/wget.mo
	/usr/share/locale/ga/LC_MESSAGES/wget.mo
	/usr/share/locale/gl/LC_MESSAGES/wget.mo
	/usr/share/locale/he/LC_MESSAGES/wget.mo
	/usr/share/locale/hr/LC_MESSAGES/wget.mo
	/usr/share/locale/hu/LC_MESSAGES/wget.mo
	/usr/share/locale/id/LC_MESSAGES/wget.mo
	/usr/share/locale/it/LC_MESSAGES/wget.mo
	/usr/share/locale/ja/LC_MESSAGES/wget.mo
	/usr/share/locale/lt/LC_MESSAGES/wget.mo
	/usr/share/locale/nb/LC_MESSAGES/wget.mo
	/usr/share/locale/nl/LC_MESSAGES/wget.mo
	/usr/share/locale/pl/LC_MESSAGES/wget.mo
	/usr/share/locale/pt/LC_MESSAGES/wget.mo
	/usr/share/locale/pt_BR/LC_MESSAGES/wget.mo
	/usr/share/locale/ro/LC_MESSAGES/wget.mo
	/usr/share/locale/ru/LC_MESSAGES/wget.mo
	/usr/share/locale/sk/LC_MESSAGES/wget.mo
	/usr/share/locale/sl/LC_MESSAGES/wget.mo
	/usr/share/locale/sr/LC_MESSAGES/wget.mo
	/usr/share/locale/sv/LC_MESSAGES/wget.mo
	/usr/share/locale/tr/LC_MESSAGES/wget.mo
	/usr/share/locale/uk/LC_MESSAGES/wget.mo
	/usr/share/locale/vi/LC_MESSAGES/wget.mo
	/usr/share/locale/zh_CN/LC_MESSAGES/wget.mo
	/usr/share/locale/zh_TW/LC_MESSAGES/wget.mo
	/usr/share/man/man1/wget.1.gz

rpm -qf 路径 #查询路径是由哪个包安装的

[root@localhost Packages]# rpm -qf /usr/bin/vi
	vim-minimal-7.4.160-1.el7.x86_64

[root@localhost Packages]# which ls
	alias ls='ls --color=auto'
		/usr/bin/ls
[root@localhost Packages]# rpm -qf `which ls | tail -1 | cut -f 2`
	coreutils-8.22-11.el7.x86_64

修改于 171110

转载于:https://my.oschina.net/hellopasswd/blog/1570796

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值