2014年9月26日 星期五

[Linux 文章收集] Linux rpm List Installed Packages

Source From Here 
Preface 
How do I list all installed packages using rpm command on CentOS/Suse/Fedora/RHEL/Scientific and Red Hat Enterprise Linux? 

The rpm command is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. The latest version of Red hat and friends recommend using the yum command

rpm command syntax 
The rpm command has -a option to query (list) all installed packages. 

List all installed packages using rpm -a option 
Open the Terminal or login to the remote server using ssh client. Type the following command as root user: 
# rpm -qa
...
audit-2.2-4.el6_5.x86_64
acl-2.2.49-6.el6.x86_64
ncurses-devel-5.7-3.20090208.el6.x86_64
libthai-0.1.12-3.el6.x86_64
telnet-0.17-47.el6_3.1.x86_64
...

You can display more information about package using the following command: 
# rpm -qi iptables
Name : iptables Relocations: (not relocatable)
Version : 1.4.7 Vendor: CentOS
Release : 11.el6 Build Date: Sat 23 Nov 2013 09:00:42 AM CST
Install Date: Sat 27 Sep 2014 09:09:19 AM CST Build Host: c6b8.bsys.dev.centos.org
Group : System Environment/Base Source RPM: iptables-1.4.7-11.el6.src.rpm
Size : 855952 License: GPLv2
Signature : RSA/SHA1, Mon 25 Nov 2013 03:31:44 AM CST, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem
URL : http://www.netfilter.org/
Summary : Tools for managing Linux kernel packet filtering capabilities
Description :
The iptables utility controls the network packet filtering code in the
Linux kernel. If you need to set up firewalls and/or IP masquerading,
you should install this package.

You can list package files using the following command: 
# rpm -ql iptables
/bin/iptables-xml-1.4.7
/etc/rc.d/init.d/iptables
/etc/sysconfig/iptables-config
/lib64/libip4tc.so.0-1.4.7
...

Feel free to add pager such as less or more to display output one screen at a time: 
# rpm -qa | less
# rpm -qa | more
# rpm -qa | grep 'something'
# rpm -ql iptables | more

Supplement 
* Man pages: rpm(8)yum(8)

沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...