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

Rookie learning Linux 029th note-taking software management, rpm command

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Rookie learning Linux 029th note-taking software management, rpm command

Application:

Program: the underlying Architecture is closely related

C language: source code-- > (compile) binary format

Script: interpreter (binary program)

Source code-- > compile-- > link-- > run

Program:

Library

Static state

Dynamic

Static link

Dynamic link

Program: instruction + data

Linux shared library .so (shared object)

Program configuration file:

Program components:

Binary program

Libraries (which contain the program's own private libraries) put their own library files into / lib / usr/lib

Configuration file

Help file

Linux level 1 directory

/ boot

/ etc

/ usr

/ var

/ lib

/ tmp

/ bin

/ sbin

/ proc

/ sys

/ mnt

/ media

/ home

/ root

/ misc

/ opt

/ srv

The directory involved in installing the software:

1. Programs that are needed for system startup cannot be mounted to an additional partition and must be on the root (except the help documentation directory)

/ etc, program configuration file

/ bin, program binaries

/ sbin, program binaries

/ lib, library file

/ usr/share/man (help file) Global shared read-only directory

two。 Provide system core functions that can be partitioned separately (not recommended)

/ usr/

Bin

Sbin

Lib

3. Install third-party software and partition separately (recommended)

/ usr/local

Bin

Sbin

Lib

Etc

Man

/ opt early third-party software is installed to this directory

Other directories

The following two directories are called pseudo file systems and cannot be partitioned separately. They are empty by default (only after startup)

/ proc provides the calling interface to the user

/ sys hardware call interface

/ dev device files cannot be partitioned separately!

Udev can use the hardware information provided by the kernel to create device files dynamically.

And give the device file a name that makes it easy for the user to understand.

/ home home directory, it is recommended to be alone, but it is not very useful as a server

/ root administrator home directory can be partitioned separately but not recommended

/ var peripheral files, system log files, etc., it is recommended to partition separately

/ boot kernel, initrd (initramfs) recommends separate partitioning

POST-- > BIOS (HD)-- > (MBR) bootloader (file system architecture, ext2,ext3...)-- > kernel

/ boot a partition root lvm

Program: instruction + data

Instructions: chip

CPU: general instruction, privileged instruction

Instruction set

Compiler instruction-- > assembly instruction-- > corresponding chip instruction (intel,Amd,Powerpc...)

Package manager

1. Packaged into one file: binary program, library file, configuration file, help file

two。 Generate a database to track every file installed

Function

1. Make a software package

two。 Install, uninstall, upgrade, query, verify

Redhat,SUSE: RPM

Redhat Package Manager

RPM is Package Manager

Debian: dpt

Dependencies:

When installing software with rpm, you may encounter the need to install B software first to install A software.

The installation of B software requires the installation of C software, which is called dependency.

Back-end tools, when rpm dpt installs the software, you need to solve the dependencies when installing the software.

Other software on which the software depends needs to be manually installed

Front-end tools, yum apt-get can automatically help users solve the dependencies when installing software

That is, to automatically install other software that needs to be installed.

Front-end tool: yum apt-get

Backend tools: RPM, dpt

Yum: yellowdog Update Modifier

Rpm command

Rpm:

Database: / var/lib/rpm

Rpmbuild:

Installation, query, uninstall, upgrade, verification, database reconstruction, verification of packets, etc.

Rpm naming:

Packages: component

Main package:

Bind-9.7.1-1.i589.e15.rpm

Subpackage:

Bind-lib-9.7.1-1.8586.e15.rpm

Package name format

Name-version-release-.arch.rpm

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

Major version number: major improvement

Minor version number: an important change has taken place in a sub-function.

Issue number: fix part of bug, adjust a little function

Rpm package:

Binary format

Source code format

View the current system kernel version

Uname (print system information)

-a,-- all

Print all information, in the following order, except omit-p

And-i if unknown:

Rpm command:

1. Installation

Rpm {- I |-- install} [install-options] PACKAGE_FILE...

Rpm-ivh / path/name.rpm

-- nodeps

Don't do a dependency check before installing or upgrading

A package. Ignore dependencies, but the software may not run after installation

-- force is forcibly installed and can be reinstalled or downgraded

-- test Do not install the package, simply check for and report

Potential conflicts.

two。 Query

Rpm-Q PACKAGE_NAME cannot follow the path to query whether the specified package has query installed.

Rpm-qa queries all installed packages all

Rpm-qi PACKAGE_NAME queries the description information of the specified package information

Rpm-ql PACKAGE_NAME query the list of files generated by the specified package installation list directory

Rpm-qc PACKAGE_NAME queries the configuration file config of the specified installation package

Which rpm package installation generates the files specified by the rpm-qf / path/to/somefile query

-qd PACKAGE_NAME query the help file of the package docfiles

-Q-script contained in the scripts PACKAGE_NAME query package

If a rpm package has not been installed, we need to query its description and the files that will be generated after installation

Rpm-qpi / path/to/package.rpm

3. Upgrade

Rpm-Uvh / path/to/new_package_file.rpm upgrade if older version is installed, otherwise install

Rpm-Fvh / path/to/new_package_file.rpm upgrade if the older version is installed, otherwise exit

-- oldpackage downgrade

4. Unloading

Rpm-e PACKAGE_NAME Uninstall rpm package erase

-nodeps uninstalls but does not delete dependent rpm packages

5. Check

Rpm-V PACKAGE_NAME Verification rpm package

6. Rebuild rpm database

Rpm

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

Initdb: initial Chinese database. If you don't have it, you don't need to build it.

Use-initdb to create a new database if one doesn't already

Exist (existing database is not overwritten)

Use-rebuilddb to rebuild the database indices from the installed

Package headers.

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

Encryption Typ

Symmetry: encryption and decryption using the same key

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

Unidirectional: MD5

/ etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release stores verification information public key

If you do not import verification information, rpm cannot authenticate the data of the package

Import validation information

Rpm--import / etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Rpm {- K |-- checksig} [--nosignature] [--nodigest] / path/to/package.rpm

Used to verify the integrity and legitimacy of the installation package

Dsa, gpg: verify the validity of the source of the package, that is, verify the signature-nodigest ignores this item

Shal, md5: verify package integrity: you can ignore this item using-- nosignature

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