How to use linux rpm command parameters

王林
Release: 2023-05-19 20:46:04
forward
1614 people have browsed it

rpm Execute the installation package
There are two types of binary packages (binary) and source code packages (source). Binary packages can be installed directly on the computer, while source code packages will be automatically compiled and installed by rpm. Source code packages often have src.rpm as the suffix.
Commonly used command combinations:
-ivh: Installation displays the installation progress--install--verbose--hash
-uvh: Upgrade software packages--update;
-qpl: List rpm software packages File information in [query package list];
-qpi: List the description information of the rpm package [query package install package(s)];
-qf: Find which rpm package the specified file belongs to [query file];
-va: Verify all rpm packages and find lost files [view lost];
-e: Delete packages

rpm -q samba //查询程序是否安装
rpm -ivh /media/cdrom/redhat/rpms/samba-3.0.10-1.4e.i386.rpm //按路径安装并显示进度
rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm    //指定安装目录
rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm    //用来检查依赖关系;并不是真正的安装;
rpm -uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm //新版本降级为旧版本
rpm -qa | grep httpd     #[搜索指定rpm包是否安装]--all搜索*httpd*
rpm -ql httpd         #[搜索rpm包]--list所有文件安装目录
rpm -qpi linux-1.4-6.i368.rpm #[查看rpm包]--query--package--install package信息
rpm -qpf linux-1.4-6.i368.rpm #[查看rpm包]--file
rpm -qpr file.rpm       #[查看包]依赖关系
rpm2cpio file.rpm |cpio -div   #[抽出文件]
rpm -ivh file.rpm  #[安装新的rpm]--install--verbose--hash
rpm -ivh http://mirrors.kernel.org/fedora/core/4/i386/os/fedora/rpms/gaim-1.3.0-1.fc4.i386.rpm
rpm -uvh file.rpm   #[升级一个rpm]--upgrade
rpm -e file.rpm     #[删除一个rpm包]--erase
Copy after login

Common parameters:
install/upgrade /erase options:

-i, --install                     install package(s)
-v, --verbose                     provide more detailed output
-h, --hash                        print hash marks as package installs (good with -v)
-e, --erase                       erase (uninstall) package
-u, --upgrade=<packagefile>+      upgrade package(s)
--replacepkge                    无论软件包是否已被安装,都强行安装软件包
--test                            安装测试,并不实际安装
--nodeps                          忽略软件包的依赖关系强行安装
--force                           忽略软件包及文件的冲突
query options (with -q or --query):
-a, --all                         query/verify all packages
-p, --package                     query/verify a package file
-l, --list                        list files in package
-d, --docfiles                    list all documentation files
-f, --file                        query/verify package(s) owning file
Copy after login

rpm source code package installs files ending with
.src.rpm. These files are packaged by the source code of the software. Users need to install this type of rpm software. Package, you must use the command:

rpm --recompile vim-4.6-4.src.rpm  #这个命令会把源代码解包并编译、安装它,如果用户使用命令:
rpm --rebuild vim-4.6-4.src.rpm  #在安装完成后,还会把编译生成的可执行文件重新包装成i386.rpm 的rpm软件包。
[root@localhost src]# rpm -ivh awstats-6.8-1.noarch.rpm
error: failed dependencies:
perl(lwp::useragent) is needed by awstats-6.8-1.noarch
[root@localhost src]#
Copy after login

Use the rpm attribute dependent package file

[root@localhost src]# rpm -qpr awstats-6.8-1.noarch.rpm
/bin/sh
/usr/bin/perl
config(awstats) = 6.8-1
perl >= 0:5.005
perl(lwp::useragent)
perl(posix)
perl(socket)
perl(time::local)
perl(strict)
perl(vars)
rpmlib(compressedfilenames) <= 3.0.4-1
rpmlib(payloadfileshaveprefix) <= 4.0-1
Copy after login

The above is the detailed content of How to use linux rpm command parameters. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template