Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Linux, how do I uninstall a version of Perl which was built from source?

I need to un-install a version of Perl which was built from source. The directory from which it was built exists. However I didn't find a make target called 'uninstall'. The Perl version I have is 5.12.2 and is installed on a Fedora distributed Linux.

like image 648
raghu Avatar asked Apr 27 '11 12:04

raghu


2 Answers

Because perl has no 'make uninstall' target, you need to remove the files manually. The best way to do this is to get a complete list of files installed. To do that you need to:

  1. Create a temporary directory, e.g. /usr/local/src/temp/perl
  2. Edit the Makefile in your original perl source directory (hopefully you didn't delete it) and add the path from step 1 above to the beginning of all install lines (e.g. bin = ..., scriptdir = ..., INSTALLPREFIXEXP = ...)
  3. Run make install
  4. Navigate to your temp directory and run: find . -type f > filelist.txt
  5. Edit this file and make sure you actually want to delete eveything in there (you will screw up your system real bad if you mess this up)
  6. Run cat filelist.txt | xargs rm
  7. Manually delete the perl5 library directory (usually at something like /usr/local/lib64/perl5 - you can find it in the filelist.txt file)

That's it, all gone.

Next time isolate it in a separate directory and just symlink it :-)

like image 147
Mike Dacre Avatar answered Sep 19 '22 22:09

Mike Dacre


If the Perl is installed in its own directory - say /opt/perl/v5.12.2 - and was built from source, then the 'ultimate sanction' works well:

rm -fr /opt/perl/v5.12.2

I almost always build my own Perl; I always build my Perl so it installs in its own, unique directory; when I finally get around to removing it, this is how I do it.

like image 32
Jonathan Leffler Avatar answered Sep 20 '22 22:09

Jonathan Leffler