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