Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux command: rpm package management

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduction to the rpm command:

Rpm: software Manager

Database: / var/lib/rpm is used to query the database of related operations by the software.

Rpmbuild: a tool for creating rpm packages

Install, query, uninstall, upgrade, verify, rebuild the database, verify the data package and so on.

1. Command format:

1. Rpm naming rules:

Main package:

Usage: httpd-2.2.15-15.e16.centos.i686.rpm

Httpd: package name 2.2.15: software version number 15: number of software releases

E16.centos: suitable linux platform i686: suitable hardware platform rpm:rpm package extension

Subpackage:

Usage:httpd-libs-2.2.15-15.i586.rpm

Package name format:

Name-version-release.arch.rpm

Bind-major.minor.release-release.arch.rpm

Major version number: only major improvements will change.

Minor version number: a major change has taken place in a sub-function

Issue number: fixed part of bug and adjusted some functions

2. Command function:

Manage, install, query, uninstall, upgrade, verify, rebuild the database, verify the data package and so on.

3. Command parameters:

1. Rpm software installation

Rpm-I / PATH/TO/PACKACE-FILE-I: indicates installation

-h: show progress in #, with each # representing 2%

-v: show detailed progress

-vv: displays more detailed information

Rpm-ivh

-- nodeps: ignore dependencies

-- replacepkgs: reinstall and replace the previously installed software

-- force: forced installation can be reinstalled or downgraded

2. Query the installed rpm software

Rpm-Q package name query specifies whether the package has been installed

Rpm-qa queries all packages that have been installed

Rpm-qi package name: query the description of the specified package

Rpm-ql package name: query the list of files generated after the specified package is installed

Rpm-qc package name: query the configuration file for the specified package installation

Rpm-qd package name: query the help files for the specified package installation

Rpm-Q-- scripts package name: query the scripts contained in the specified package

Rpm-qf / path/to/somefile: query that the specified file is generated by that rpm package installation

2.1.Query a rpm package that has not been installed. You need to query the instructions and files that will be generated after installation.

Rpm-qpi / PATH/TO/PACKAGE_FILE (path to rpm)

3. Rpm upgrade

Rpm-Uvh / PATH/TO/NAW_PACKAGE_FILE (new package): upgrade if the old version is installed; otherwise, install

Rpm-Fvh / PATH/TO/NAW_PACKAGE_FILE (new package): upgrade if the old version is installed; otherwise, exit

Rpm-ivh-- oldpackage / PATH/TO/OLD_PACKAGE_FILE: downgrade

4. Uninstall the rpm package

Rpm-e PACKAGE_NAME Uninstall package

-- nodeps: ignore dependencies

5. Verify the rpm package

Rpm-V PACKAGE_NAME check package

6. Rebuild the database

Rpm

-- rebuilddb: if the database is rebuilt, it will be re-established.

-- initdb: initialize the database. If you don't have it, you don't have to build it. If you have it, you don't have to.

7. Verify the validity of the source and the integrity of the software package

Encryption type:

Symmetry: encryption and decryption using the same key

Public key: a pair of keys, public keys, private keys: the public key is hidden in the private key and can be extracted and made public

One way:

Rpm--import / etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release import key file (only r ehat systems can be verified)

Rpm-K / PAPT/TO/PACKAGE_FILE

Dsa,gpg: verify the validity of the source, that is, verify the signature; you can skip this item with-- nosignature

Shal,md5: verify package integrity: you can use-- nodigest, skip this item

4. Command example:

1. Query whether the package is installed

Rpm-Q gcc to see if gcc is installed

[root@xuelinux gcc-4.5.1] # rpm-Q gcc

Gcc-4.4.7-4.el6.i686 indicates that gcc is installed

Rpm-- qa gcc views gcc software help files

[root@xuelinux gcc-4.5.1] # rpm-qd gcc

/ usr/share/doc/gcc-4.4.7/COPYING

/ usr/share/doc/gcc-4.4.7/COPYING.LIB

/ usr/share/doc/gcc-4.4.7/COPYING3

/ usr/share/doc/gcc-4.4.7/COPYING3.LIB

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report