Labels

Linux (46) network (13) troubleshoot (13) command (10) virtualization (10) ubuntu (9) Windows (8) cisco (7) security (7) router (6) Tools (5) software (5) vmware (5) ospf (3) eigrp (1) zimbra (1)

2010年3月10日

RPM command example

Install
# rpm -ivh foo-2.0-4.i386.rpm
# rpm -i ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm
# rpm -i http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm

Erase
# rpm -e foo

Upgrade
# rpm -Uvh foo-1.0-2.i386.rpm
# rpm -Uvh ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm
# rpm -Uvh http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm

Query
# rpm -qa  <------To query all installed packages.
# rpm -q foo  <------To query a RPM package.
# rpm -qi foo  <------To display package information.
# rpm -ql foo  <------To list files in installed package
# rpm -qf /usr/bin/mysql  <------Which package owns a file?
mysql-3.23.52-3
# rpm -qpl kernel-2.4.20-18.10.1.i686.rpm
# rpm -qpl ftp://ftp.redhat.com/pub/redhat/RPMS/foo-1.0-1.i386.rpm
# rpm -qpl http://oss.oracle.com/projects/firewire/dist/files/kernel-2.4.20-18.10.1.i686.rpm
List files in RPM file.

Verify
# rpm --verify mysql
To verify an installed package. The output is listed using the following codes that signify what failed:
S File size
  M Mode (includes permissions and file type)
  5 MD5 sum
  L Symlink 
  D Device 
  U User 
  G Group 
  T Mtime

Take for example the following:
# rpm --verify mysql
  S.5....T c /etc/my.cnf
This example indicates that file /etc/my.cnf failed on:
File size 
  MD5 Sum 
  Modified Time 
However, the "c" tells us this is a configuration file so that explains the changes. It should still be looked at to determine what the changes were.

沒有留言:

張貼留言