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 installation of linux

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

Share

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

! Command: execute linux commands under other systems, such as #! pwd: view the path

Under the lftp command: (subcommand: single file download: get; directory download: mirror; multiple file download: mget; exit: bye)

1. Composition of the software package:

Software package composition: (binaries, library files, configuration files, help files)

Binary program file:

Storage path: / bin;/sbin;/usr/bin;/usr/sbin;/usr/local/bin;/usr/local/sbin

/ bin;/sbin: binary files needed to boot the system itself

/ usr/sbin;/usr/local/bin: binary files needed to complete basic management after system startup

/ usr/local/bin;/usr/local/sbin: binaries required for third-party management

Library file: (also an executable file, but cannot be executed independently and needs to be called for execution) is often called a function in a program.

Storage path: / lib;/usr/lib;/usr/local/lib

Library file classification: static libraries (files ending in .a), dynamic libraries (files ending in .so)

Library file configuration path: / etc/ld.so.conf;/etc/ld.so.conf.d/*.conf

Configuration file:

Storage path: / etc

Help file:

Help file classification: manual (/ usr/share/man); README;INSTALL; usually put the last two in / usr/share/doc

The configuration file of man is in / etc/man_db.conf (define man to go to × × help file)

2. Linux package management tools:

Package management tools should include: file manifest, file location, software function description, dependency (dependent on other packages)

Package management tools database: track the location of the software installation, facilitate uninstallation operations, most of which are stored under / var/lib/rpm

The package front-end management tool automatically finds and resolves the dependencies between packages, and then installs the required packages.

Debian: dpt;apt-get (package front-end management tool)

Redhat:rpm;yum (package front-end management tool)

Suse:rpm

Package installation method: package management tool installation, source code compilation and installation, package manager front-end tools, general binary format

Package management tool installation: functions realized by rpm: packaging, installation, query, upgrade, verification, uninstallation, etc.

Compile and install: compile the source code into a binary format file; provide an environment (such as compiler: gcc,g++; library file)

As the compilation installation can only be installed manually, in order to facilitate management (uninstall, upgrade), generally install to a specific text, which brings problems: such as cannot find the binary file execution (because there is no definition in the environment variable), can not find the library file, can not find the help manual (you can modify the configuration file or use the command: man-M / path to specify the help file path), header file path (/ usr/include).

Third, the naming of software packages and source programs:

1. Name the source program:

Name-version.tar. {gz | bz2 | xz} (package name-version number. Suffix name)

The version number is composed of major.minor.release (major version number). The second edition number. Release number); the major version number is generally a major change in the program, the minor version number is generally a change in part of the function of the program, and the hair model is generally repaired by bug. Check the corresponding version number when upgrading.

Such as: bash-4.3.1.tar.xz

2. Name the rpm package:

Name-version-release.arch.rpm (package name-source program version number-package version number. Platform .rpm; platform refers to the host architecture, such as: i686 release x86century 64meme amd64ppcpowernoarch (which means platform-independent). Here the PPC is the management number packaged by the publisher and may also include the applicable operating system (e.g. centos6).

And version also contains major.minor.release (major version number. The second edition number. Release number), explaining the release of the same source program

Such as: bash-4.3.2-5.e16.x86_64.rpm package name. Source program version number. Package version number and applicable operating system. Platform .rpm

3. Rpm subpackage naming: make some functions into a separate package, which is required to install.

Main package name-subpackage name-version-release.arch.rpm generally depends on the main package, that is, to install the subpackage, the main package must be installed

Main package: core package; bind

Subcontracting: subcontracting; bind-chroot

Such as: bind-chroot

4. Package location:

Usually put it under packet

Fourth, software package acquisition and verification of software packages:

Red Hat package third-party platform: epel, now maintained by fedora; therefore, it is also called fedroa-epel:

Http://mirrors.sohu.com; the software here is generally not included on the system CD.

Http://rpmfind.net; used to search rpm bags

Http://rpm.pbone.net; used to search rpm bags

Rpm package verification mechanism: source legitimacy, package integrity

Gpg pgp:

Redhat series official public key storage location:

[root@promote ~] # ls / etc/pki/rpm-gpg/ Show the public key file

RPM-GPG-KEY-CentOS-7 RPM-GPG-KEY-CentOS-Debug-7 RPM-GPG-KEY-CentOS-Testing-7

[root@promote ~] #

[root@promote ~] # rpm--import / etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 / / Import the public key

[root@promote ~] # rpm-K zziplib-utils-0.13.62-5.el7.x86_64.rpm / / verify that the source of the packet is valid

Zziplib-utils-0.13.62-5.el7.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

[root@promote ~] #

Installation, uninstallation, query, upgrade and verification of rpm package

1. Rpm package installation: specify the path to the installation file (from which file to install)

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

Install-options:

-v: display details

-vv: show more details

-h: the installation progress is indicated by #, and a # indicates 2% progress.

-- nodeps: ignore dependencies; Note: ignoring dependencies may install the software package, but it may not work properly after installation

-- test: test the installation only, but not install it

-- replacepkgs: reinstall the package, replacing all files of the installed package

Common combination:-ivh

Such as:

[root@promote] # rpm-ivh / cdrom/Packages/zsh-5.0.2-14.el7.x86_64.rpm

[root@promote] # rpm-ivh zziplib-utils-0.13.62-5.el7.x86_64.rpm

Error: Failed dependencies:

Libzzip-0.so.13 () (64bit) is needed by zziplib-utils-0.13.62-5.el7.x86_64

Libzzipfseeko-0.so.13 () (64bit) is needed by zziplib-utils-0.13.62-5.el7.x86_64

Libzzipmmapped-0.so.13 () (64bit) is needed by zziplib-utils-0.13.62-5.el7.x86_64

Zziplib (x86-64) = 0.13.62-5.el7 is needed by zziplib-utils-0.13.62-5.el7.x86_64

[root@promote ~] # rpm-ivh / cdrom/Packages/

Note: the rpm installation package does not automatically install dependent packages

[root@promote] # rpm-ivh-- replacepkgs / cdrom/Packages/zsh-5.0.2-14.el7.x86_64.rpm

2. Uninstall rpm package: you only need to refer to the package name when uninstalling.

Rpm {- e |-- erase} [--allmatches] [--nodeps] [--noscripts]

-- nodeps: ignore dependencies

-- test: test uninstall

Such as:

[root@promote] # rpm-e zsh

[root@promote ~] #

Note: during installation or uninstallation, if any changes are made to the write file, rpm will back up the modified file cp, which can be seen in the warning message; waring.

3. Rpm package query:

Rpm {- Q |-- query} [select-options] [query-options]

3.1 query information about installed software packages

Rpm-qa: query all packages / / does not support golbing

Rpm-qa | grep 'package name': query specific packages

Rpm-qi 'package name': query the summary information of the package

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

Rpm-qf 'specific path to a file': query which rpm package installation generated a file

Rpm-qc 'package name': query the list of configuration files after the package is installed

Rpm-qd 'package name': query the list of help documents generated after the package is installed

Rpm-Q-scripts' package name': query the relevant scripts executed by the software package

Related script categories:

Preinstall: pre-installation script

Postinstall: post-installation script

Preuninstall: pre-uninstall script

Postuninstall: script after uninstall

Such as:

[root@promote] # rpm-Q zsh

Package zsh is not installed

[root@promote ~] # rpm-qa | grep zsh

Zsh-5.0.2-14.el7.x86_64

[root@promote ~] # rpm-qi zsh / / query the summary information of the software package

[root@promote ~] # rpm-ql zsh | less// queries the list of files generated by zsh installation and displays them in pages

[root@promote ~] # rpm-qf / usr/share/zsh/site-functions/ query which rpm package site-functions is installed by

Systemd-219-19.el7.x86_64

Pulseaudio-6.0-7.el7.x86_64

Zsh-5.0.2-14.el7.x86_64

[root@promote ~] #

[root@promote ~] # rpm-qf / etc/passwd / / query / etc/passwd is generated by which rpm package is installed

Setup-2.8.71-6.el7.noarch

[root@promote ~] #

3.2. Query the information generated after installation of the uninstalled software package and add p after the Q option.

Rpm-qpi 'rpm installation package path': query the summary information that will be generated if the package is installed

Rpm-qpl 'rpm installation package path': query the list of files that will be generated if the package is installed

Rpm-qpc 'rpm installation package path': query the list of configuration files that will be generated if the package is installed

Rpm-qpd 'rpm installation package path': query the list of help documents that will be generated by the package if installed

Rpm-qp-- scripts' package name': query the relevant scripts that will be executed if the package is installed

Such as:

[root@promote ~] # rpm-qpi zziplib-utils-0.13.62-5.el7.x86_64.rpm / / Note here is the package path, not the package name

[root@promote cdrom] # rpm-qi zziplib-utils-0.13.62-5.el7.x86_64.rpm / / Direct check will prompt that the software is not installed

Package zziplib-utils-0.13.62-5.el7.x86_64.rpm is not installed

4. Rpm package upgrade

Rpm {- U |-- upgrade} [install-options] PACKAGE_FILE...

Rpm {- F |-- freshen} [install-options] PACKAGE_FILE...

-- force: forcibly upgrade when the old and new versions conflict

-- nodeps: ignore dependencies

Both-U and-F can be upgraded, except that-U can be upgraded or newly installed;-F can only be upgraded, if the old version is not installed, this command does not take effect; therefore, it is recommended to use-U

Common combination command:-Uvh;-Fvh

It should be noted that when upgrading, it may lead to dependency conflicts, such as x depends on y1.0, and x depends on y2.0 after upgrade.

Note: the kernel should not be upgraded, it should be installed, it allows many versions to coexist.

5. Rpm packet verification:

Rpm {- V |-- verify} [select-options] [verify-options]

After the general software package is installed, it is checked with rpm-V 'package name'. If the installed file is changed, the information will be output.

Such as:

[root@promote] # rpm-V zsh

S.5....T. C/ etc/zshrc

S file Size differs

Explain the output information, some are not output here:

M Mode differs (includes permissions and file type)

5 digest (formerly MD5 sum) differs

D Device major/minor number mismatch

L readLink (2) path mismatch

U User ownership differs

G Group ownership differs

T mTime differs

P caPabilities differ

. Indicates that no modification has been made

6. The database of rpm package:

Most database files in the linux system are stored in: / var/lib directory

Rpm package database: / var/lib/rpm

[root@promote ~] # ls / var/lib/rpm-l

Total 106552

-rw-r--r--. 1 root root 7254016 Dec 19 11:05 Basenames

-rw-r--r--. 1 root root 16384 Nov 29 20:31 Conflictname

-rw-r--r--. 1 root root 270336 Dec 19 11:34 _ _ db.001 / / _ _ indicates a lock file

-rw-r--r--. 1 root root 81920 Dec 19 11:34 _ _ db.002

-rw-r--r--. 1 root root 1318912 Dec 19 11:34 _ _ db.003

-rw-r--r--. 1 root root 2154496 Dec 19 11:05 Dirnames

-rw-r--r--. 1 root root 36864 Dec 19 11:05 Group

-rw-r--r--. 1 root root 24576 Dec 19 11:05 Installtid

-rw-r--r--. 1 root root 106496 Dec 19 11:05 Name

-rw-r--r--. 1 root root 45056 Dec 6 22:17 Obsoletename

-rw-r--r--. 1 root root 94273536 Dec 19 11:05 Packages

-rw-r--r--. 1 root root 2596864 Dec 19 11:05 Providename

-rw-r--r--. 1 root root 724992 Dec 19 11:05 Requirename

-rw-r--r--. 1 root root 176128 Dec 19 11:05 Sha1header

-rw-r--r--. 1 root root 118784 Dec 19 11:05 Sigmd5

-rw-r--r--. 1 root root 8192 Nov 29 20:30 Triggername

[root@promote ~] #

If the database of the rpm package is corrupted, rpm will not be able to query, uninstall, upgrade, verify, etc.

Rpm [--initdb |-- rebuilddb]

-- initdb: create a new database; the original file will not be overwritten

-- rebuilddb; rebuilds the database; overwrites the original file; uses more

7. Rpm package in source format: a file name that generally contains .src strings

Such as: tcl-tclreadline-2.1.0-3.el7.src.rpm

Packing: the package of rpm has been made according to the spec file.

Make rpmbuild:

Introduction to yum: automatically find, download and resolve dependencies of rpm packages (front-end management tools)

1. Yum server:

The implementation of yum warehouse (yum repository): remote mode (ftp://,http://), local mode (file:///etc/)

Generally, rpm packages are placed under these paths, and # createrepo is used to create source data

The path of repodata storage is the path of yum warehouse.

The steps required for the yum installation implementation:

Yum warehouse production: (generally available online (e.g. http://mirrors.aliyun.com/centos/7/updates/x86_64/), but if you want to create it yourself, you can follow the following process:)

Optical disc: the optical disc system is mounted under the system and can be used as a yum warehouse directly.

Download online to local production: 1, download data to local, 2, create source data

Createrepo: source data for creating yum repositories

Createrepo [options] / / create source data. Directory indicates the path where the rpm package is located.

For example, create a new warehouse:

[root@promote Packages] # cp a * / yum / / copy all files starting with a to / yum as rpm package repository

[root@promote Packages] # createrepo / yum / / generate repodata from the source data of the software package under / yum

2. Yum client:

Yum install | reinstall | remove

Yum installation depends on yum repository

The yum configuration file defines the yum repository (where to find software packages)

Yum main configuration file: / etc/yum.conf / / core configuration file

The sub-configuration file of the yum repository: / etc/yum.repos.d/*.repo / / you can customize the yum repository source and put it in this directory

2.1.Example of yum client master profile:

[main] / / define which warehouse, the name of the warehouse, and provide default configuration for the sub-warehouse

Cachedir=/var/cache/yum/$basearch/$releasever / / cache directory, which directory is cached

Keepcache=0 / / cache retention time

Debuglevel=2 / / debug level. The higher the number, the higher the level.

Logfile=/var/log/yum.log / / log file

Exactarch=1 / / matches the local platform (32\ 64 bit). 1 means yes, 0 means no.

Obsoletes=1

Gpgcheck=1 / / check the signature of the rpm package and check the validity of the source. 1 means yes, 0 means no

Plugins=1

Installonly_limit=5

Bugtracker_url= http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum

Distroverpkg=centos-release

2.2.The customization of yum client terminal warehouse: (please note: there can be no spaces before and after "=")

[repository_ID] / / name whatever you want, as long as there is no conflict

Name= / / Warehouse name description information, essential

Path to baseurl= / / warehouse, such as ftp, http, file, etc.

Whether the enables= / / warehouse is enabled. 1 means enabled, 0 means not enabled.

Gpgcheck= / / check the validity of the package. 1 means enabled, 0 means not enabled.

Gpgkey= / / if validity checking is enabled, you need to define the key path; no matter where you put it, you can access it.

Cost= / / defines the cost of access. The smaller the number, the lower the cost, and the higher the priority.

Such as:

[base]

Name=CentOS-$releasever-Base

Mirrorlist= http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

Baseurl= http://mirrors.aliyun.com/centos/7/updates/x86_64/ repodata is in the x86 / 64 directory.

Gpgcheck=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Note: the yum repository path can use the yum built-in variable to match the platform ($basearch) and version ($releasever):

For example, cachedir=/var/cache/yum/$basearch/centos/$releasever / / $releasever only matches the release major version number; $basearch matches the platform; for example, match / var/cache/yum/i386/centos/7,var/cache/yum/x86_64/centos/6

9. The yum command tool uses:

1. Yum displays relevant information

Yum [options] [command] [package...]

Command:

List [all | installed | available | updates | extras | recent]: show all packages | installed packages | installable packages | updatable packages | packages that cannot be classified into yum warehouses, additional packages | newly added packages for yum warehouses

Repolist [all | enabled | disabled: view all warehouses | enabled warehouses | disabled warehouses

Info [package name]: equivalent to rpm-qi, displaying summary information

Grouplist: displays which package group information is available

Groupinfo "Group name": displays specific package group information

Clean [packages | metadata | expire-cache | rpmdb | plugins | all]: clear the relevant cache

Makecache [fast]: manually establish a local cache

Provides | whatprovides feature1 [feature2] [..] / / query which package is installed in the file

Search string1 [string2] [...] / / query packages with corresponding strings; fuzzy matching

Note: yum list supports viewing both installed and uninstalled packages, while rpm can only support one. Yum supports globing,rpm but not.

Such as:

[root@promote yum.repos.d] # yum list | less

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: ftp.sjtu.edu.cn

* extras: ftp.sjtu.edu.cn

* updates: ftp.sjtu.edu.cn

Installed Packages

389-ds-base.x86_64 1.3.4.0-19.el7 @ anaconda

Zziplib-utils.x86_64 0.13.62-5.el7 base

Zsh.x86_64 5.0.2-14.el7 installed

/ / the order is: software package. Platform source file version number-the release version number has been installed; @ indicates it has been installed, and @ is installed through which warehouse; no @ indicates no installation; installed indicates that it has been installed

[root@promote yum.repos.d] # yum repolist

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: ftp.sjtu.edu.cn

* extras: ftp.sjtu.edu.cn

* updates: ftp.sjtu.edu.cn

Repo id repo name status

Aliyum centos7 393

Base/7/x86_64 CentOS-7-Base 9363

Extras/7/x86_64 CentOS-7-Extras 435

Updates/7/x86_64 CentOS-7-Updates 393,

Repolist: 10584

[root@promote yum.repos.d] #

[root@promote ~] # yum provides / etc/passwd

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: mirrors.cn99.com

* extras: ftp.sjtu.edu.cn

* updates: mirrors.cn99.com

Setup-2.8.71-7.el7.noarch: A set of system configuration and setup files

Repo: base

Matched from:

Filename: / etc/passwd

Setup-2.8.71-6.el7.noarch: A set of system configuration and setup files

Repo: @ anaconda

Matched from:

Filename: / etc/passwd

[root@promote ~] #

[root@promote ~] # yum search zsh / / search for software packages containing strings

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: mirrors.cn99.com

* extras: ftp.sjtu.edu.cn

* updates: mirrors.cn99.com

= = N matched S: zsh = =

Zsh-html.x86_64: Zsh shell manual in html format

Zsh.x86_64: Powerful interactive shell

Name and summary matches only, use "search all" for everything.

[root@promote ~] #

2. Yum installation:

Yum [options] [command] [package...]

Command:

Install package1 [package2] [...]: install the software package; for yum installation, you only need to specify the installation package name, not the path, because he will automatically search in the yum repository, but rpm must specify the path to the installation file; if you install here, you need to confirm manually, and you can use-y to confirm automatically.

Reinstall package1 [package2] [...]: reinstall the package

Localinstall rpmfile1 [rpmfile2] [...]: install the local rpm package, resolve the local rpm package dependency, discard the command, but check the package validity. You can use-- nogpgcheck to disable the validity check.

(maintained for legacy reasons only-use install)

Localupdate rpmfile1 [rpmfile2] [...]: upgrade the local rpm package; discard command

(maintained for legacy reasons only-use update)

Yum installation requires the use of yum repositories. Yum can also install rpm packages directly without yum repositories, such as:

[root@promote Packages] # yum install zsh-html-5.0.2-14.el7.x86_64.rpm / / you need to specify the package path

[root@promote ~] # yum localinstall zziplib-utils-0.13.62-5.el7.x86_64.rpm / / yum install the local rpm package

3. Yum upgrade and downgrade:

Yum [options] [command] [package...]

Command:

Update [package1] [package2] [...] / / upgrade

Update-to [package1] [package2] [..] / / specify a version upgrade (package name followed by version number)

Check-update: check if the package has an upgrade package

Upgrade [package1] [package2] [..] / / is also an upgrade, which is not needed now.

Upgrade-to [package1] [package2] [..] / / upgrade to the specified version, not now

Downgrade package1 [package2] [...] / / downgrade

Such as:

[root@promote ~] # yum update-to python2-pyasn1.noarch

4. Yum uninstall: yum automatically uninstalls packages that depend on it when it uninstalls the software

Yum [options] [command] [package...]

Command:

Remove | erase package1 [package2] [..] / / Uninstall the package

Such as:

[root@promote ~] # yum remove bind

[root@promote ~] # yum erase zsh

5. Yum package group query and installation: if there is a space between the group names, it needs to be enclosed by "(quotation marks)."

Yum [options] [command] [package...]

Command:

Groups [install | list | update | remove]: install, query, upgrade and uninstall package groups

Such as:

[root@promote ~] # yum groups list / / query which package groups are available

[root@promote yum.repos.d] # yum groups install "Development Tools" / / installation package group

Generally speaking, the development environment package groups are:

"Development", "Server Platform Development", "Desktop Platform Development".

6. Query the operation history of yum:

Yum [options] [command] [package...]

Command:

History [info | list | packages-list | packages-info | summary | addon-info | redo | undo | roll-

Back | new | sync | stats]

Such as:

[root@promote ~] # yum history

Loaded plugins: fastestmirror, langpacks

ID | Login user | Date and time | Action (s) | Altered

8 | root | 2016-12-19 19:40 | Erase | 2

7 | root | 2016-12-19 19:40 | Erase | 1 EE

6 | root | 2016-12-19 19:34 | Obsoleting | 2

5 | root | 2016-12-19 17:40 | Reinstall | 1

4 | root | 2016-12-19 17:37 | Update | 1

3 | root | 2016-12-19 17:31 | I, U | 7

1 | System | 2016-11-29 20:14 | Install | 1949

Warning: RPMDB altered outside of yum.

History list

[root@promote ~] #

7 、 yum

Yum [options] [command] [package...]

Command:

Version [all | installed | available | group-* | nogroups* | grouplist | groupinfo]

10. Compilation and installation of source files:

Update system time: # ntpdata x.x.x.x / / point to the time server

1. Download a source format file, such as Apache source file:

[root@promote ~] # wget http://mirrors.sohu.com/apache/httpd-2.4.25.tar.gz

2. Decompress the file

Tar [OPTION...] [FILE]...

OPTION

-xf: extract all files:

[root@promote ~] # tar-xf httpd-2.4.25.tar.gz / / decompress, a file with no compression suffix will appear

[root@promote ~] # ls

Abc.txt first.sh httpd-2.4.25.tar.gz zziplib-utils-0.13.62-5.el7.x86_64.rpm

Anaconda-ks.cfg httpd-2.4.25 ion

[root@promote ~] #

3. Compile and install:

(compiling files use gcc or glossy commands, but he can't solve the call relationship between files. The make command can solve it automatically, but he still needs to call gcc or glossary files.)

Make compiles a set of files and solves the call relationship; make compilation depends on makefile files, which determine the file order and parameters for compilation; makefile files are generated by configure scripts plus makefile.in; configure scripts are generated by the development tool autoconf; makefile.in is generated by automake

Makefile=configure script + makefile.in

Make [- f makefile] [options]... [targets]...

Make install / / installation

Summary:

Compile steps:

1. Execute the command #. / configure / / in the source code program directory to check whether the compilation environment is complete; let the user customize the compilation configuration (through the script option)

2. Execute the command # make compilation

3. Install binaries: # make install

When compiling and installing the specified path, the program may not find the corresponding path and can only be executed with the path. If you run the relevant commands without a path, you need to modify the PATH file to include the corresponding / bin, or / sbin; to modify the library file path to include the corresponding library: / etc/ld.so.conf,/etc/ld.so.conf.d/*.conf; configuration file does not need to be exported; modify the help file path / etc/man.conf, plus MANPATH=

Modify the environment variable:

You can create a file ending with .sh in / etc/profile.d in this directory, adding:

Export PATH=/usr/local/apr/bin:$PATH

Export the library file:

[root@promote bin] # vim / etc/ld.so.conf.d/apr.conf

Enter the content:

/ usr/local/apr/lib

Then save and exit.

Execute the command # ldconfig-v to re-search the library file

Export the help file:

[root@promote bin] # vim / etc/man_db.conf

Add a path to it:

MANPATH / usr/local/apr/man

Then save and exit.

Link header file:

# [root@promote httpd-2.4.25] # ln-sv / usr/local/apr/include / usr/include

View the library on which the program runs: # ldd program

For example: # ldd / bin/ls

Ldconfig-v: re-search all library files on the current system under the search path and generate cache / etc/ld.so.cache

11. Rpm installation in source code format:

Rpm in source code format cannot be used directly after installation; it needs to be compiled into a rpm package.

Steps:

1. Download the source code rpm package:

[root@promote ~] # wget

Http://mirrors.aliyun.com/epel/7/SRPMS/n/nginx-1.10.2-1.el7.src.rpm

2. View the list of files generated after installing nginx-1.10.2-1.el7.src.rpm:

[root@promote] # rpm-qpl nginx-1.10.2-1.el7.src.rpm

Warning: nginx-1.10.2-1.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

404.html

50x.html

README.dynamic

UPGRADE-NOTES-1.6-to-1.10

Index.html

Nginx-1.10.2.tar.gz

Nginx-1.10.2.tar.gz.asc

Nginx-auto-cc-gcc.patch

Nginx-logo.png

Nginx-upgrade

Nginx-upgrade.8

Nginx.conf

Nginx.logrotate

Nginx.service

Nginx.spec / / rpm relies on .spec files to generate rpm packages

Poweredby.png

3. Install the nginx-1.10.2-1.el7.src.rpm package:

[root@promote ~] # useradd mockbuild / / installation files require mockbuild users and mockbuild groups

[root@promote] # rpm-ivh nginx-1.10.2-1.el7.src.rpm

Warning: nginx-1.10.2-1.el7.src.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Updating / installing...

1:nginx-1:1.10.2-1.el7 # # [100%]

[root@promote ~] #

It is generally installed to the current folder:

[root@promote ~] # ls

Abc.txt axel-2.4.tar.gz nginx-1.10.2-1.el7.src.rpm

Anaconda-ks.cfg first.sh rpmbuild

Apr-1.5.2 httpd-2.4.25 wps-office_10.1.0.5672~a21_x86_64.tar.xz

Apr-1.5.2.tar.bz2 httpd-2.4.25.tar.gz zziplib-utils-0.13.62-5.el7.x86_64.rpm

Axel-2.4 ion

[root@promote ~] # cd rpmbuild/

[root@promote rpmbuild] # ls

Under SOURCES SPECS / / SOURCES are source programs, patches, scripts and other files; .sepc under SPECS makes rpm packages

[root@promote rpmbuild] #

4. Make rpm package

[root@promote SPECS] # rpmbuild-ba nginx.spec

[root@promote SPECS] # cd..

[root@promote rpmbuild] # ls

BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

[root@promote rpmbuild] #

[root@promote rpmbuild] # ls RPMS/

Noarch x86_64

[root@promote rpmbuild] # cd RPMS/ this directory is the production number of the rpm package; you can install it directly

[root@promote RPMS] # cd x86_64/

[root@promote x86: 64] # ls / / View the finished rpm package

Nginx-1.10.2-1.el7.centos.x86_64.rpm

Nginx-debuginfo-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-http-geoip-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-http-p_w_picpath-filter-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-http-perl-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-http-xslt-filter-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-mail-1.10.2-1.el7.centos.x86_64.rpm

Nginx-mod-stream-1.10.2-1.el7.centos.x86_64.rpm

[root@promote x86_64] #

[root@promote x86_64] # cd..

[root@promote RPMS] # ls

Noarch x86_64

[root@promote RPMS] # cd..

[root@promote rpmbuild] # ls

BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

[root@promote rpmbuild] # ls SRPMS/ this directory is the source format rpm package

Nginx-1.10.2-1.el7.centos.src.rpm

[root@promote rpmbuild] #

5. Install the RPM package

[root@promote x861464] # rpm-ivh nginx-1.10.2-1.el7.centos.x86_64.rpm

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