Search This Blog

Wednesday 2 March 2011

Useful rpm commands

Listing files Related to one installed RPM.
Command: rpm --query --filesbypkg 
Eg:to list all the files related to installed rpm mysql-5.1.51-2.fc14.i686
[root@latheefTest /]# rpm --query --filesbypkg  mysql-5.1.51-2.fc14.i686|more
mysql                     /usr/bin/msql2mysql
mysql                     /usr/bin/my_print_defaults
mysql                     /usr/bin/mysql
mysql                     /usr/bin/mysql_config
mysql                     /usr/bin/mysql_find_rows
mysql                     /usr/bin/mysql_waitpid
mysql                     /usr/bin/mysqlaccess
mysql                     /usr/bin/mysqladmin
mysql                     /usr/bin/mysqlbinlog
mysql                     /usr/bin/mysqlcheck
mysql                     /usr/bin/mysqldump
mysql                     /usr/bin/mysqlimport
mysql                     /usr/bin/mysqlshow
mysql                     /usr/bin/mysqlslap
mysql                     /usr/lib/mysql/mysql_config
mysql                     /usr/lib/mysql/mysqlbug
mysql                     /usr/share/doc/mysql-5.1.51
mysql                     /usr/share/doc/mysql-5.1.51/COPYING
mysql                     /usr/share/doc/mysql-5.1.51/EXCEPTIONS-CLIENT
mysql                     /usr/share/doc/mysql-5.1.51/README
mysql                     /usr/share/doc/mysql-5.1.51/README.mysql-docs
mysql                     /usr/share/man/man1/my_print_defaults.1.gz
mysql                     /usr/share/man/man1/mysql.1.gz
mysql                     /usr/share/man/man1/mysql_config.1.gz
mysql                     /usr/share/man/man1/mysql_find_rows.1.gz
mysql                     /usr/share/man/man1/mysql_waitpid.1.gz
mysql                     /usr/share/man/man1/mysqlaccess.1.gz
mysql                     /usr/share/man/man1/mysqladmin.1.gz
mysql                     /usr/share/man/man1/mysqldump.1.gz
mysql                     /usr/share/man/man1/mysqlshow.1.gz
mysql                     /usr/share/man/man1/mysqlslap.1.gz


Getting information about rpm which is not installed, but locally available

Command: rpm rpm -qi
Eg:to list the information regarding rpm package mysql-5.1.51-2.fc14.i686
[root@latheefTest /]# rpm -qi  mysql-5.1.51-2.fc14.i686
Name        : mysql                        Relocations: (not relocatable)
Version     : 5.1.51                            Vendor: Fedora Project
Release     : 2.fc14                        Build Date: Thu 07 Oct 2010 02:01:06 PM EDT
Install Date: Wed 10 Nov 2010 03:49:43 AM EST      Build Host: x86-13.phx2.fedoraproject.org
Group       : Applications/Databases        Source RPM: mysql-5.1.51-2.fc14.src.rpm
Size        : 2451091                          License: GPLv2 with exceptions
Signature   : RSA/SHA256, Thu 07 Oct 2010 05:06:25 PM EDT, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.mysql.com
Summary     : MySQL client programs and shared libraries
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. The base package
contains the standard MySQL client programs and generic MySQL files.


Checking which rpm package installed a specific system file.
Command: rpm rpm -qf
Eg:I want to see, which rpm package created /etc/hosts file
[root@latheefTest /]# rpm -qf /etc/hosts
setup-2.8.23-1.fc14.noarch




Getting the detailed information about an installed package.



[root@latheef~]# rpm -qi mysql-server-5.1.51-2.fc14.x86_64
Name        : mysql-server                 Relocations: (not relocatable)
Version     : 5.1.51                            Vendor: Fedora Project
Release     : 2.fc14                        Build Date: Thu 07 Oct 2010 09:02:12 PM AST
Install Date: Tue 09 Nov 2010 06:55:13 AM AST      Build Host: x86-09.phx2.fedoraproject.org
Group       : Applications/Databases        Source RPM: mysql-5.1.51-2.fc14.src.rpm
Size        : 24571485                         License: GPLv2 with exceptions
Signature   : RSA/SHA256, Fri 08 Oct 2010 12:02:05 AM AST, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.mysql.com
Summary     : The MySQL server and related files
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. This package contains
the MySQL server and some accompanying files and directories.

To get the complete documents (help files and manfiles) information about the installed package.

[root@latheef~]# rpm -qd mysql-server-5.1.51-2.fc14.x86_64
/usr/share/doc/mysql-server-5.1.51/my-huge.cnf
/usr/share/doc/mysql-server-5.1.51/my-innodb-heavy-4G.cnf
/usr/share/doc/mysql-server-5.1.51/my-large.cnf
/usr/share/doc/mysql-server-5.1.51/my-medium.cnf
/usr/share/doc/mysql-server-5.1.51/my-small.cnf
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/msql2mysql.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/mysql.server.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/mysql_fix_extensions.1.gz
/usr/share/man/man1/mysql_fix_privilege_tables.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysql_setpermission.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlbug.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysqldumpslow.1.gz
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlman.1.gz
/usr/share/man/man1/mysqltest.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man8/mysqld.8.gz
/usr/share/man/man8/mysqlmanager.8.gz

Continue...


No comments:

Post a Comment