Home Operation and Maintenance Linux Operation and Maintenance How to use linux rpm command parameters

How to use linux rpm command parameters

May 19, 2023 pm 08:46 PM
linux rpm

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

See all articles