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

How to install and uninstall programs in CentOS in Linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the Linux CentOS how to install and uninstall the program related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have a harvest after reading this Linux article on how to install and uninstall the CentOS program, let's take a look.

(1) if a certain software is not provided with the "installation file" installed by rpm in the yum repository, you need to download the source code from the official website of the software and install it by [compiler].

(2) [compilation method]: step

● first, you need to download the source code from the official website of the software (of course, you can also download the source code from websites such as GitHub)

● then compiles the source code to generate an executable file using the compilation command that comes with Linux

(3) the compilation command of Linux is make.

(1) compatibility:

● [yum]: software developers have to provide corresponding installation packages for each Linux distribution; even some software installation packages for CentOS 6 and CentOS 7 are not common. Therefore, the versatility is poor.

● [compilation]: the code is universal. We only need to compile the source code to get the application.

(2) complexity:

● [yum]: "stupid" automatic and fast completion

● [compilation]: the underlying dependencies need to be installed manually, and the installation process is complicated.

(3) installation speed:

● [yum]: behind this method, only files are decompressed and copied, which is relatively fast.

● [compilation method]: to compile each source code, and then run it, the process is slow

(4) Source:

● [yum]: application repository

● [compilation method]: download the source code from the official website

(5) Application scenarios:

● [yum]: this method provides most of the system software we use on a daily basis. For these softwares, you can install them directly using [yum], which is relatively simple.

● [compilation]: some minority open source software; the latest version of the software; you need to obtain the source code and install it through [compilation]; (that is, the software installation packages provided in the [yum repository] are often not up-to-date).

Redis is a very famous NoSQL database, which usually acts as a cache in the system.

1. Download the Redis source code

But here, we demonstrate that the installation is the redis-4 version, it's all the same.

Then, upload the source package of Redis to the / usr/local directory through ftp

...

two。 Decompress the compressed package of Redis source code

...

3. Compile and install Redis (1) install the corresponding make command [underlying compiler: gcc]

Cut to the unzipped directory of redis and try using the make command:

Then it will report an error:

Therefore, you need to install [underlying compiler: gcc]: gcc: is the C language source code compilation toolkit

(PS: the reason why these packages all end with rpm, is it understandable like this: (if there is an error, modify it at any time. )

● these packages are originally the installation packages prepared by the software manufacturer for [CentOS system], and the command to install the software for [CentOS system] is rpm, so in order to correspond, the software manufacturer sets [the extension of the installation package for CentOS system] to ".rpm")

● We download these installation packages here through CentOS, and the extension of the installation package prepared by these software vendors for this version of the operating system of CentOS is rpm; (then, the extension of the installation package prepared by the software manufacturer for other versions of the operating system is not rpm).

(2) delete [contaminated source code directory after using make command for the first time] and get a source code directory again.

However, after installing gcc, invoke the make command again:

To do this, you need to delete the previously unzipped redis installation package directory, and then extract a new one:

(3) call the make command to compile and install redis

(supplement. 1) Note: it should be noted that there is another difference between [yum] and [compilation].

[yum]: the corresponding application is automatically generated in the / usr/bin directory of the system.

"compilation method" will not generate the corresponding application in the / usr/bin directory of the system; it can only generate the application in the current directory, that is, "yum" and "compilation", where the application is stored in a different location.

Indeed, through the actual measurement: redis was not found by using yum list installed:

...

This is what was in the original redis source code directory, under the src directory:

Then, this is the contents of the src directory after installing redis, and you can see that several executable commands have been added; (that is, unlike [yum], [compilation] can only generate applications in the current directory)

(supplement. 2) start redis

Use [Ctrl+C] to stop redis and return to the Linux command state:

This is the end of the article on "how to install and uninstall programs in CentOS in Linux". Thank you for reading! I believe you all have a certain understanding of "how to install and uninstall programs in Linux". If you want to learn more, you are welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report