An Straightforward Approach To Take away Packages Put in From Supply In Linux


Get real time updates directly on you device, subscribe now.

Not all packages out there within the official or third-party repositories, so you’ll be able to’t set up them utilizing the common bundle managers. Some instances, it’s a must to set up the packages by manually compiling from supply. As you might already know, while you set up packages from supply, the bundle recordsdata shall be copied to a number of areas, equivalent to /usr/native/bin, /usr/native/and so on/, on the filesystem. If the put in program from supply doesn’t have a built-in uninstaller, it will be a tedious activity to take away the packages while you don’t want it anymore. It’s possible you’ll have to spend couple (or a number of) minutes to search out these bundle recordsdata and take away them manually. That is what I’ve been doing up till I stumbled upon a utility named “GNU Stow”. Fortunately, Stow has a improbable option to simply handle packages put in from supply.

To cite the official web site,

GNU Stow is a symlink farm supervisor which takes distinct packages of software program and/or information positioned in separate directories on the filesystem, and makes them look like put in in the identical place.

To place this merely, Stow lets you preserve the bundle recordsdata organized in a option to simply manageable. On this methodology, the recordsdata is not going to be copied to a number of areas. As an alternative, all recordsdata are saved in a particular folder, normally underneath this system identify itself, and Stow creates symbolic hyperlinks to all of the packages’ recordsdata into the suitable locations. For instance, /usr/native/bin may comprise symlinks to recordsdata inside /usr/native/stow/vim/bin, /usr/native/stow/python/bin and so on., and likewise recursively for every other subdirectories equivalent to …/share, …/man, and so forth. On this tutorial, I’ll present you methods to simply handle packages put in from supply utilizing Stow with a sensible instance. Learn on.

Putting in GNU Stow

GNU Stow is on the market within the default repositories of standard Linux working programs.

On Arch Linux and its variants, run the next command to put in Stow.

$ sudo pacman -S stow

On Debian, Ubuntu, Linux Mint:

$ sudo apt set up stow

On Fedora:

$ sudo dnf set up stow


$ sudo yum set up epel-release
$ sudo yum set up stow

Simply Take away Packages Put in From Supply In Linux

As I already talked about earlier, all program recordsdata of a bundle shall be saved in a root folder positioned in /usr/native/stow/. Beneath this root or father or mother listing, every bundle shall be saved in its personal non-public sub-directory. For instance, if we set up Vim editor from supply, all program recordsdata and directories associated to Vim shall be saved underneath /usr/native/stow/vim folder. In the event you set up python from supply, all recordsdata associated to python shall be stored underneath /usr/native/stow/python and so forth.

Let me set up a program, for instance howdy, from supply.

First obtain the ‘howdy’ program’s tarball.

$ wget

Extract the downloaded tarball utilizing command:

$ tar -zxvf hello-2.10.tar.gz

The above command will create a listing named ‘hello-2.10’ within the present working listing and extract all contents in it.

Swap to the extracted listing:

$ cd hello-2.10/

Run the next command with –prefix choice.

$ ./configure –prefix=/usr/native/stow/howdy

The above command will save the construct recordsdata within the specified location i.e /usr/native/stow/howdy in our case.

Lastly, construct and set up the howdy program utilizing the next instructions:

$ make
$ sudo make set up

That’s it. The howdy program has been put in in /usr/native/stow/howdy/ location. You’ll be able to confirm it with ‘ls’ command as proven beneath.

$ ls /usr/native/stow/howdy/
bin share

Lastly, go to the /usr/native/stow/ listing and run the next command to generate the required symlinks.

$ cd /usr/native/stow/
$ sudo stow howdy

All achieved!

What simply occurred is all of the recordsdata and directories contained within the howdy bundle have been symlinked to the listing /usr/native/. In different phrases, /usr/native/stow/howdy/bin has been symlinked to /usr/native/bin and /usr/native/stow/howdy/share has been symlinked to /usr/native/share and /usr/native/stow/howdy/share/man has been symlinked to /usr/native/share/man and so forth.

You’ll be able to confirm them utilizing ‘ls’ command:

$ ls /usr/native/bin/

Allow us to examine if the howdy program is working or not utilizing command:

$ howdy
Howdy, world!

Yeah, it’s working!!

Equally, you’ll be able to set up packages as described above underneath its personal sub-directory.

Right here is the contents of the Stow root listing:

$ tree /usr/native/stow/

tree command

See? The howdy program is put in /usr/native/stow/howdy/ location. Like smart, all packages shall be stored underneath their very own listing.

Right here comes the principle half. Allow us to take away the howdy program. To take action, go to /usr/native/stow/ listing:

$ cd /usr/native/stow/

..and run the next command:

$ sudo stow –delete howdy
Remove program using Stow

Take away program utilizing Stow

The howdy program has simply been eliminated. You’ll be able to confirm whether it is actually eliminated utilizing command:

$ howdy
-bash: /usr/native/bin/howdy: No such file or listing

hello world

See? Howdy program is eliminated!

Please be aware that Stow has eliminated the symlinks solely. All program recordsdata and directories associated to howdy program are nonetheless out there in /usr/native/stow/howdy folder. So, you’ll be able to set up the howdy program once more with out having to obtain the precise supply file. In the event you don’t need it anymore, merely delete the folder.

$ sudo rm -fr /usr/native/stow/howdy/

To know extra particulars about Stow, refer the person pages.

$ man stow

Advised learn:

Stow lets you uninstall the packages as simply as you put in them. If you’re questioning methods to successfully handle loads of packages put in from supply, GNU Stow is one such program to make this activity loads simpler. Give it a strive, you received’t be disenchanted.

And, that’s all for now. Hope this was helpful. Extra good stuffs to return. Keep tuned!



Thanks for stopping by!

Assist us that will help you:

Have a Good day!!

Source link

Leave A Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More