A detailed introduction to the three installation methods of rpm, yum and source code under Linux

A detailed introduction to the three installation methods of rpm, yum and source code under Linux

Chapter 1 Source Code Installation

The installation of source packages is slower than that of RPM packages because RPM packages are specified according to specific systems and platforms.

The program will provide many RPM package formats. Users can choose the appropriate RPM package to install directly according to the system situation, while the source package is equivalent to

The general type can be used in multiple systems, so you need to run the configure script to detect the environment and generate the corresponding installation information.

1.1 Advantages of source code installation

1. Complete documentation

2. Because the code can be located, debugging is convenient

3. The native compatibility is the best (because it is compiled locally, as long as the compilation is successful, there will be no dependency issues on various libraries)

1.2 Disadvantages of source code installation

1. Compilation trouble

2. Lack of automatic dependency management, troublesome software upgrades

1.3 Installation Process

1.3.1 Unzip the source package tar file: The source package is usually archived using the tar tool and then compressed using gunzip or bzip2.
The suffix formats will be

For .tar.gz and .tar.bz2, the decompression methods are:

tar -zxvf FileName.tar.gz
tar -jxvf FileName.tar.bz2

1.3.2 Switch to the unzipped directory

cd /unzipped directory

1.3.3 Prepare for compilation: Before starting to install the service, you need to execute the configure script, which will automatically compile the current system.

A series of assessments, such as source files, software dependency libraries, compilers, assemblers, connectors, etc., and if necessary,

You can use the -prefix parameter to specify the installation path of the program. When the script checks that the system environment meets the requirements, it will

Generate a Makefile in the previous directory.

./configure -prefix=/usr/local/program

1.3.4 Generate the installation program: The Makefile generated in the previous step will save the installation rules of the system environment dependencies.

You need to use the make command to use the appropriate SHELL to compile all dependencies according to the rules provided in the Makefile file.

Source code, and then the make command will generate a final executable installation program.

make

1.3.5 Installing the service program: If the -prefix parameter is not used in the configure script phase, the program will generally be installed by default.

Installed in the /usr/local/bin directory.

make install compile and install

1.3.6 Clean up temporary files (optional):

make clean

1.3.7 Uninstall service program command (execute only when necessary)

make uninstall

1.3.8 View installation information

The whereis command locates executable files, source code files, and help files in the file system. These files

Attributes should belong to source code, binaries, or help files.

For example: where is java

whereis [-bmsu] [BMS directory name -f ] file name

-b Search the binary portion of the file.

-m Search the manual section of files.

-s Search the source section of files.

-u Undocumented files

The -B, -M, and -S flags can be used to change or limit the locations that the whereis command searches. Since the program is required to run

is faster and uses the chdir subroutine, so path names given in directory listings with the -M, -S, and -B flags must be complete;

For example, they must begin with a / (slash).

-B Same as -b, but adds directories to search. Changes or limits the locations where the whereis command searches for binary files.

-M Same as -m, but adds directories to search. Changes or limits where the whereis command searches for manual sections.

-S Same as -s, but adds directories to search. Changes or limits the locations where the whereis command searches for sources.

-f Terminates the last -M, -S, or -B directory listing and signals the start of filenames.

(IV) [Parameters] [File]

-c compress file

-x decompress the file

-t Check what files are in the compressed package

-z Compress or decompress with Gzip

-j compress or decompress with bzip2

-v Display compression or decompression process information

-f target file name

-P preserve original permissions and attributes

-p Use absolute path compression

-C specifies the directory to extract to

Chapter 2 RPM Package Installation

For an rpm package, it is composed of "-" and ".", and basically consists of the following parts:

* Package name * Version information * Release version number * Operating platform. When noarch appears, it means that the software is compatible with the platform.

2.1 Common usage 1

2.1.1 Installation

  • rpm -i package file to be installed
  • rpm -iv package file to be installed (display installation details)
  • rpm -ivh package file to be installed (displays installation details and progress)

2.1.2 Upgrade

  • rpm -U package file that needs to be upgraded
  • rpm -Uvh package file that needs to be upgraded (display upgrade details and progress)

2.1.3 Uninstall

  • rpm -e software package to be uninstalled

Note: If other programs depend on the package to be uninstalled, the system will prompt that it cannot be deleted. If you need to force deletion, add --nodeps.

It will be deleted forcibly, but it may cause the software that depends on it to fail to run.

2.1.4 Check installed

rpm -qa

2.1.5 View the specified package

  • rpm -qa | grep "name of software or package"

2.2 Common Methods 2

2.2.1 The first type: Query the installed software service information

1. Query the software installed in the system

rpm -qa

2. Query which software package an installed file belongs to;

  • rpm -qf absolute path of the file name

3. Check where the installed software packages are installed;

The software name is defined as: the information after removing the platform information and suffix of the rpm package

  • rpm -ql software name

4. Query information about an installed software package

  • rpm -qi software name

5. Check the configuration files of the installed software;

  • rpm -qc software name

6. View the document installation location of an installed software:

  • rpm -qd software name

7. Check the software packages and files that the installed software depends on;

  • rpm -qR software name

2.2.2 Second method: Query information about packages that are not installed

1. View the purpose, version and other information of a software package;

  • rpm-qpi rpm file

2. View the files contained in a software package;

  • rpm -qpl rpm file

3. Check the location of the software package documentation;

  • rpm -qpd rpm file

4. View the configuration file of a software package;

  • rpm -qpc rpm file

5. View the dependencies of a software package

  • rpm -qpR rpm file

2.2.3 [Options] [Parameters]:

-a: query all packages

-e: Delete the specified package

-f<file>: query the package that has the specified file;

-h or --hash: Display progress information

-i: Display detailed information of the package

-i<package> or --install<package>: Install the specified package

-l: Display the file list of the package

-p: query the specified RPM package

-q: Use query mode

-U <package> or --upgrade <package>: Upgrade the specified package

-v: Display the command execution process;

-vv: Display the instruction execution process in detail to facilitate troubleshooting.

Commonly used command combinations:

-ivh: installation displays installation progress --install --verbose --hash

-Uvh: Upgrade software package --Update;

-qpl: List the file information in the RPM package [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: Check all RPM packages and find missing files [View Lost];

-e: remove package

--force Force operations such as forced deletion, etc.;

--requires displays the dependencies of the package;

--nodeps Ignore dependencies and continue

Chapter 3 yum

3.1 Installation Process

1. Installation: yum install software

2. Upgrade: yum update software

3. Delete: yum remove software

4. View: yum info software

5. Search software: yum search software

6. Check dependencies: yum deplist software

7. View installed software: yum list installed

3.2 [Options] [Parameters]:

-e silent execution

-t Ignore errors

-R[minutes] Set the waiting time

-y automatically answers yes

check-update Check for updatable packages

clean all

clean packages Clear temporary package files (files under /var/cache/yum)

clean headers Clear rpm header files

clean oldheaders Clear old rpm header files

deplist lists the dependencies of a package

list of installable and updatable RPM packages

list installed packages

list extras Installed packages not in the repository

info Installable and updatable RPM package information

info installed Information about installed packages (similar to the -qa parameter)

install[RPM package] installation package

localinstall Install local RPM package

update [RPM package] update package

upgrade upgrade system

search[keyword] search package

provides[keyword] Search for a specific package file name

reinstall[RPM package] Reinstall the package

repolist displays the configuration of the resource library

resolvedep specifies dependencies

remove[RPM package] uninstall package

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to install MySQL under Linux (yum and source code compilation)
  • Install MySQL database 5.6 source code under Linux and change the login user password
  • Tutorial on installing mysql5.6.20 from source code under linux
  • Compile and install PostgreSQL9.5 from source code on Linux CentOS 7
  • How to install mysql source package in Linux CentOS6.6 system
  • Notes on installing MySQL source code under Linux
  • Sharing the steps of compiling, installing and configuring SVN server under Linux
  • How to install MySQL 5.6 from source code under SUSE Linux
  • Linux+php+apache+oracle environment construction: source code compilation and installation of PHP under CentOS
  • Analysis of Linux kernel scheduler source code initialization

<<:  How to use axios to filter multiple repeated requests in a project

>>:  Tips for Mixing OR and AND in SQL Statements

Recommend

jQuery realizes the shuttle box function

This article example shares the specific code of ...

CSS3 achieves flippable hover effect

CSS3 implements a flippable hover effect. The spe...

Three examples of nodejs methods to obtain form data

Preface Nodejs is a server-side language. During ...

Simple implementation method of vue3 source code analysis

Table of contents Preface 🍹Preparation 🍲vue3 usag...

Detailed tutorial on how to monitor Nginx/Tomcat/MySQL using Zabbix

Table of contents Zabbix monitors Nginx Zabbix mo...

The background color or image inside the div container grows as it grows

Copy code The code is as follows: height:auto !im...

HTML form submission method case study

To summarize the form submission method: 1. Use t...

MySQL 8.0.18 adds users to the database and grants permissions

1. It is preferred to use the root user to log in...

Let's talk about the LIMIT statement in MySQL in detail

Table of contents question Server layer and stora...

Essential bonus items for optimizing and packaging the front end of Vue projects

Table of contents Preface 1. Routing lazy loading...

IE8 Developer Tools Menu Explanation

<br />This article has briefly explained the...

Vue implements a visual drag page editor

Table of contents Drag and drop implementation Dr...

How to publish a locally built docker image to dockerhub

Today we will introduce how to publish the local ...