RPM多种用法(举例)及在CentOS中干掉console-kit-daemon
今天优化系统的时候,发现有个占用系统资源比较多的 console-kit-daemon 进程/线程为了在CentOSv6.2系统当中消灭它(原来那玩意儿用于用户快速切换),特在网上找了一些 RPM 命令的用法,记录如下。
● 查看内存里面的进程名字
ps -eLf | more 一页一页地查看 (不光进程,线程也会列出来,注意中间那个L是大写字母)
================================
● 一般常用的 安装命令就是 rpm -ivh 软件包名.rpm
● rpm 强制删除 rpm -e 软件包名 --nodeps
--test 可以用于做演习, 并没有真正删除或者安装进去
● 找出执行文件路径
[*]which console-kit-daemon
[*]
[*]/usr/sbin/console-kit-daemon
● 查看该文件属于哪个 RPM包
[*]rpm -qif /usr/sbin/console-kit-daemon
[*]
[*]Name : ConsoleKit Relocations: (not relocatable)
[*]Version : 0.4.1 Vendor: CentOS
[*]Release : 3.el6 Build Date: Thu 11 Nov 2010 02:50:34 AM CST
[*]Install Date: Sat 29 Jun 2013 07:51:43 PM CST Build Host: c6b1.bsys.dev.centos.org
[*]Group : System Environment/Libraries Source RPM: ConsoleKit-0.4.1-3.el6.src.rpm
[*]Size : 252541 License: GPLv2+
[*]Signature : RSA/8, Sun 03 Jul 2011 12:03:00 PM CST, Key ID 0946fca2c105b9de
[*]Packager : CentOS BuildSystem <http://bugs.centos.org>
[*]URL : http://www.freedesktop.org/wiki/Software/ConsoleKit
[*]Summary : System daemon for tracking users, sessions and seats
[*]Description :
[*]ConsoleKit is a system daemon for tracking what users are logged
[*]into the system and how they interact with the computer (e.g.
[*]which keyboard and mouse they use).
[*]It provides asynchronous notification via the system message bus.
● 好了,知道了包大致名称,寻找一些究竟有多少个和他相关的已经安装的包
[*] rpm -qa |grep ConsoleKit
[*]
[*]ConsoleKit-libs-0.4.1-3.el6.i686
[*]ConsoleKit-0.4.1-3.el6.i686
[*]ConsoleKit-x11-0.4.1-3.el6.i686
● 用下面这个命令可以看看该安装报下面究竟都有些什么文件(列出文件清单)
[*] rpm -ql ConsoleKit-x11-0.4.1-3.el6.i686
[*]
[*]/usr/libexec/ck-collect-session-info
[*]/usr/libexec/ck-get-x11-display-device
[*]/usr/libexec/ck-get-x11-server-pid
------------------------------------------------------
———————————————————————————
● 我们有一个安装包, 在安装前我们想知道他里面究竟要安装哪些文件到我们的系统当中去
[*]rpm -qpl ConsoleKit-0.4.1-3.el6.i686.rpm
[*]
[*]warning: ConsoleKit-0.4.1-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
[*]/etc/ConsoleKit
[*]/etc/ConsoleKit/run-seat.d
[*]/etc/ConsoleKit/run-session.d
[*]/etc/ConsoleKit/seats.d
[*]/etc/ConsoleKit/seats.d/00-primary.seat
[*]/etc/dbus-1/system.d/ConsoleKit.conf
[*]/etc/event.d/ck-log-system-restart
[*]/etc/event.d/ck-log-system-start
[*]/etc/event.d/ck-log-system-stop
[*]/usr/bin/ck-history
[*]/usr/bin/ck-launch-session
[*]/usr/bin/ck-list-sessions
[*]/usr/lib/ConsoleKit
[*]/usr/lib/ConsoleKit/run-seat.d
[*]/usr/lib/ConsoleKit/run-session.d
[*]/usr/lib/ConsoleKit/scripts
[*]/usr/lib/ConsoleKit/scripts/ck-system-restart
[*]/usr/lib/ConsoleKit/scripts/ck-system-stop
[*]/usr/sbin/ck-log-system-restart
[*]/usr/sbin/ck-log-system-start
[*]/usr/sbin/ck-log-system-stop
[*]/usr/sbin/console-kit-daemon
[*]/usr/share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
[*]/usr/share/doc/ConsoleKit-0.4.1
[*]/usr/share/doc/ConsoleKit-0.4.1/AUTHORS
[*]/usr/share/doc/ConsoleKit-0.4.1/COPYING
[*]/usr/share/doc/ConsoleKit-0.4.1/NEWS
[*]/usr/share/doc/ConsoleKit-0.4.1/README
[*]/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
[*]/var/log/ConsoleKit
[*]/var/run/ConsoleKit
● 当然, 用 rpm -qpi 参数可以查看该安装包的 详细信息。
[*]rpm -qpi ConsoleKit-devel-0.4.1-3.el6.i686.rpm
[*]
[*]warning: ConsoleKit-devel-0.4.1-3.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
[*]Name : ConsoleKit-devel Relocations: (not relocatable)
[*]Version : 0.4.1 Vendor: CentOS
[*]Release : 3.el6 Build Date: Thu 11 Nov 2010 05:55:19 AM CST
[*]Install Date: (not installed) Build Host: c5b2.bsys.dev.centos.org
[*]Group : Development/Libraries Source RPM: ConsoleKit-0.4.1-3.el6.src.rpm
[*]Size : 39204 License: MIT
[*]Signature : RSA/8, Sun 03 Jul 2011 12:03:00 PM CST, Key ID 0946fca2c105b9de
[*]Packager : CentOS BuildSystem <http://bugs.centos.org>
[*]URL : http://www.freedesktop.org/wiki/Software/ConsoleKit
[*]Summary : Development files for ConsoleKit
[*]Description :
[*]This package contains headers and libraries needed for
[*]developing software that is interacting with ConsoleKit.
页:
[1]