Commands --rpm Oct 16 2021
upgrade and install
1. **-U (upgrade) ** an upgrade operation means if you have install a version of package and this command will remove the old version and install the latest version .if you not install the package before ,it will install a new one
2. **-i (install)** an install operation installs packages,but it may be install all kinds of the version package that you do not want ,therefor ,it had batter to install by **-U** *it can upgrade or install many packages at one time*
rpm –U jikes-1.16-1.i386.rpm
rpm –i jikes-1.16-1.i386.rpm
check the installed package
-q (query) an query operation that ask the RPM database is installed the package or not
rpm –q jikes
getting feedback during installation and upgrades
-h (hence) the -h option to the rpm commands prints out # signs. Maybe it will take a long time to update an package,so it is important to show it is running .it is just a sign
rpm -Uh jikes-1.16-1.i386.rpm
rpm -ih jikes-1.16-1.i386.rpm
-v (verbose) the verbose operation will tell you the command to print out verbose information .Although
rpm -Uhv jikes-1.16-1.i386.rpm
rpm -Uhv is the most common used commands to install a package
taking a test drive
–test the --test command tells the rpm command to test the process of installing or upgrading but not to install the file. e.g.
rpm -U --test jikes-1.16-1.i386.rpm
package jikes-1.16-1 is already installed # just a mode
chap4.txt: not an rpm package (or package manifest): # have not install yet
installing in different directories
–prefiex : the command allows you to install the package in a different location .the basic format of the command with --prefilx option is
rpm -U --prefix /new/directory package.rpm
query all files of an installed package
-ql: query list all files of an packages
rpm -ql a.rpm
query recent installed packages
-qa: query all
rpm -qa --last
rpm -qa # query all the packages installed
remove a rpm package
-e: (erase): 剔除,v means Vbose all kinds of ,详细的信息,vv means the vbose of vbose that installed
rpm -evv nx
query a file that belongs which rpm package
-qf: query from
[root@tecmint]# rpm -qf /usr/bin/htpasswd
httpd-tools-2.2.15-15.el6.centos.1.i686
query the information of installed rpm installed package
-qi query information
[root@tecmint]# rpm -qi vsftpd
Name : vsftpd Relocations: (not relocatable)
Version : 2.2.2 Vendor: CentOS
Release : 11.el6 Build Date: Fri
查看二进制可执行程序是动态链接(dynamically linked)还是静态链接(statically linked)
file filename
查看一个动态链接的二进制可执行程序具体调用了哪些外部函数库
ldd 可执行程序文件名
reference
- https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch03s02.html
- https://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/#:~:text=RPM%20%28Red%20Hat%20Package%20Manager%29%20is%20an%20default,manage%20system%20software%20packages%20in%20Unix%2FLinux%20operating%20systems.