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 easily delete source installed software packages in Linux

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

Share

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

Step 1: install Stow

In this example, we are using CentOS, so we need an extended EPEL library. You can install them using the following command:

Yum install epel-release

Then, the following command:

Yum install stow

Press Y to confirm the installation:

Now that stow is installed, we must choose the location where to store the package files.

Step 2: select the location to store the package file

The normal "make install" command copies the package files to various locations. Stow works by putting them all in one place in a directory and then creating symbolic links to where they should be.

So we need to select a directory for the directory where all the package files are saved for stow. By convention, this is usually:

/ usr/local/stow/

In this location, each package has a directory. Therefore, if we are going to install the "hello" program we used as an example in the previous article, the file will be stored in:

/ usr/local/stow/hello

This position can be anything. Just to show that we will store the file in the following location:

/ home/bhagwad/stow/

Step 3: use the "make install" and "prefix" options

As we saw in the previous article, the following command is required to install from the source code:

. / configuremakemake install

To install using stow, we simply change the last step to:

Make install prefix=/home/testuser/stow/hello

The "prefix" option tells us to put the package in the given location. This location is just the directory selected in step 2, where the package name is added as a separate folder. This causes the files to be installed to the given location, as follows:

Now let's put all the files needed in the package in a folder in the stow directory.

Step 4: use stow to complete the installation

To install the package, first place "cd" in the stow directory, as follows:

Cd / home/testuser/stow

Make sure that the folder that contains the files is only a directory under the current location. Now enter:

Stow hello

The package is now installed on your system. This is a screenshot of the "hello" command:

Step 5: delete the package

The coolest part about loading is how easy it is to remove the package from the system. There is no need to keep the source package or anything. Simply navigate to the stow directory, as shown in step 4, and enter:

Stow-delete hello

It's done! You can see below that the command is no longer valid after this step:

As far as the system is concerned, the package has been completely deleted! It's a good thing to remember that the file didn't actually disappear. They are still in the "hello" directory. You can easily install the package again using the stow command. If you no longer need these files, just delete the "hello" folder and the system will be clean!

Summary

The above is the editor to introduce to you how to easily delete the source installation of the software package in Linux, hope to help you, if you have any questions, please leave me a message, the editor will reply to you in time. Thank you very much for your support for the website.

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