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

Package Management rpm

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Package and package manager package composition: binaries, library files, configuration files, help file package manager:

   debian:   deb file, dpkg package manager

   redhat:   rpm file, rpm package manager

   rpm:    Redhat Package Manager

  RPM Package Manager package naming and toolkits: between classifying and unpacking packages: there may be dependencies, even circular dependencies to resolve dependency package management tools

Yum: the front-end tool for    rpm package manager

Apt:    deb package Manager front-end tool

Zypper: rpm front-end management tool on    suse

Dnf:    Fedora 18 + rpm package Manager front-end management tools package source management package method:

Use the package manager: rpm

Use the front-end tools: yum, dnf to get the package:

(1) the CD-ROM of the system version or the official server

CentOS image:

Https://www.centos.org/download/

Http://mirrors.aliyun.com

Http://mirrors.sohu.com

Http://mirrors.163.com

(2) official site of the project

(3) third-party organizations:

Search engine:

Http://pkgs.org

Http://rpmfind.net

Http://rpm.pbone.net

Https://sourceforge.net/

(4) self-made rpm is the management tool of RPM software package. Rpm, originally a Red Hat Linux distribution program designed to manage Linux suites, is popular because it follows GPL rules and is powerful and convenient. Gradually adopted by other distributions. The emergence of RPM suite management mode makes Linux easy to install and upgrade, which indirectly improves the applicability of Linux. Command options-a: query all packages;-b + or-t +: set the completion phase of the wrapper suite and specify the file name of the package file;-c: only list the configuration file, this parameter should be used with the "- l" parameter;-d: only list the text file, this parameter should be used with the "- l" parameter -e or-- erase: delete the specified package;-fspeak: query the package with the specified file;-h or-- hash: list the tags when the package is installed;-I: display information about the suite;-I or-- install: install the specified package file;-l: display the list of files for the suite;-query: query the specified RPM file;-Q: use the query mode, when any questions are encountered, the rpm instruction will first ask the user -R: display the relevant information of the suite;-s: display the file status, this parameter needs to be used with the "- l" parameter;-U or-- upgrade: upgrade the specified package file;-v: display the instruction execution process;-vv: show the instruction execution process in detail, easy to debug. Packet query

Rpm-K | checksig rpmfile: check the integrity and signature of the package

Database rebuild: / var/lib/rpm sample: install the rpm package

Rpm-ivh your-package.rpm

Where your-package.rpm is the file name of the rpm package you want to install, which is usually placed in the current directory.

The following warnings or prompts may appear during installation:

... Conflict with...

It is possible that some files in the package to be installed may overwrite existing files, which cannot be installed correctly by default. You can use rpm-- force-I to force the installation.

... Is needed by...

... Is not installed...

Note: if you do not install some of the software required by this package, you can use rpm-- nodeps-I to ignore this information, that is to say, rpm-I-- force-- nodeps can ignore all dependencies and file problems, and any package can be installed, but this forcibly installed package does not guarantee full functionality.

How to install the .src.rpm package

Some packages end in .src.rpm, which are rpm packages that contain source code and need to be compiled at installation time. There are two ways to install such packages:

Method 1:

Rpm-I your-package.src.rpm

Cd / usr/src/redhat/SPECS

Rpmbuild-bp your-package.specs    # A specs file with the same name as your software package

Cd / usr/src/redhat/BUILD/your-package/    # A directory with the same name as your package

. / configure    # this step is the same as compiling ordinary source software, you can add parameters

Make

Make install method 2:

Rpm-I you-package.src.rpm cd / usr/src/redhat/SPECS

The first two steps are the same as method one.

Rpmbuild-bb your-package.specs    # A specs file with the same name as your software package

At this time in / usr/src/redhat/RPM/i386/ (depending on the package, it may be i686 no arch, etc.) in this directory, there is a new rpm package, which is the compiled binary file.

Execute rpm-I new-package.rpm to complete the installation.

3. How to uninstall the rpm package

Use the command rpm-e package name, which can contain information such as the version number, but cannot have the suffix .rpm, such as uninstalling the package proftpd-1.2.8-1.

The following formats are available

Rpm-e proftpd-1.2.8-1

Rpm-e proftpd-1.2.8

Rpm-e proftpd-

Rpm-e proftpd error format

Rpm-e proftpd-1.2.8-1.i386.rpm

Rpm-e proftpd-1.2.8-1.i386

Rpm-e proftpd-1.2

Rpm-e proftpd-1

Sometimes there are errors or warnings.

... Is needed by...

It shows that this software is required by other software and cannot be uninstalled at will. It can be forced to be uninstalled with rpm-e-nodeps.

4. How to get the files in the rpm package without installing

Use the tools rpm2cpio and cpio

Rpm2cpio xxx.rpm | cpio-virpm2cpio xxx.rpm | cpio-idmvrpm2cpio xxx.rpm | cpio-- extract-- make-directories

The parameter I is the same as extract, which indicates that the file is extracted. V indicates the execution process, d is the same as make-directory, indicates that the directory is established according to the original path of the file in the package, and m indicates the update time of the file.

5. How to view files and other information related to rpm packages

All of the following examples assume the use of the package mysql-3.23.54a-11

(1) I have installed those rpm packages on my system, listing all installed packages.

Rpm-qa

If you want to find all installed packages that contain a string sql

Rpm-qa | grep sql (2) how to get the full file name of a software package

Rpm-Q mysql

You can get the full name of the mysql package installed on the system, from which you can get information such as the version of the current package. You can get the information in this example mysql-3.23.54a-11 (3) look at where the files in a rpm package are installed

Rpm-ql package name

Note that here is the name of the package that does not include the .rpm suffix, which means you can only use mysql or mysql-3.23.54a-11 instead of mysql-3.23.54a-11.rpm. If you just want to know where the executable is put, you can also use which, such as:

Which mysql (4) look at those files contained in a rpm package

Look at packages that have not been installed

Rpm-qlp *. Rpm

Look at the software packages that have been installed

Rpm-ql * .rpm (5) get information about the version and purpose of a software package

Look at packages that have not been installed

Rpm-qip *. Rpm

Look at the software packages that have been installed

Rpm-qi * .rpm (6) to see which package a program is installed or which package contains the program

The rpm-qf which program name    # returns the full name of the package

The rpm-qif which program name    # returns information about the software package

The rpm-qlf which program name    # returns the file list of the package

Note: instead of quotation marks, you can also use rpm-qilf to output package information and file list (7) to see which package installed a file or which package contains the file.

Note that the method in the previous question applies only to executable programs, while the following methods can be used not only for executable programs, but also for any ordinary file. As long as you know the file name. First get the full path to the program, using whereis or which, and then use rpm-qf for example:

Whereis ftptop

Ftptop: / usr/bin/ftptop / usr/share/man/man1/ftptop.1.gz

Rpm-qf / usr/bin/ftptop

Proftpd-1.2.8-1

Rpm-qf / usr/share/doc/proftpd-1.2.8/rfc/rfc0959.txt

Proftpd-1.2.8-1

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

Servers

Wechat

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

12
Report