Delete tar.gz and untar directory??

By poertner_1274 ยท 5 replies
Oct 28, 2002
  1. I have a small hard drive in my linux box, and I am trying to get a few thigns working. I know I can delete the *.tar.gz that I have downloaded, but what about the directory made after I untar it? Is that okay to delete, or is it still somehow needed for the whatever program it was?

    Also on a side note, I am curious as to how to uninstall something that I have already installed. If it is long don't worry about it, but if you have time, or it is short that would be cool.
  2. Mictlantecuhtli

    Mictlantecuhtli TS Evangelist Posts: 4,345   +11

    When talking about source files, the directory should be safe to delete if you've done make install or similar thing. I tend to keep sources on my partition because I try different optimizations and want to add/remove features to apps sometimes.
    Uninstalling something that by default installs itself to /usr/local can be a bit tricky, because usually applications use more than just one file. Libraries are stored in /usr/local/lib, manpages in /usr/local/man, binaries in /usr/local/bin.. You get the picture. In terms of uninstalling, it would be easy to put everything in their own subdirectories by using ./configure --prefix=/this\ app\ goes\ here or something like that, but it could make things messy in the long run. As far as I know, there are no CleanSweep-lookalikes for Linux, but I might be wrong.
  3. Phantasm66

    Phantasm66 TS Rookie Posts: 5,734   +8

    You sometimes have the ability to run

    make uninstall

    if you kept the sources directory around.

    certainly, to remove the tar.gz file you would say:-

    rm nameoftarfile.tar.gz

    to delete the directory you untarred to:

    go into the directory

    cd nameoftarfile

    and say:-

    rm -fr *


    After than, go one level up, and delete the empty folder:-

    rmdir nameoftarfile

    Alternatively use some file manager like nautilus, etc...
  4. poertner_1274

    poertner_1274 secroF laicepS topShceT Topic Starter Posts: 4,172

    Yeah I knew how to do all that, just wondering how to completely uninstall the program. I was just curious as to whether or not it was a good thing to remove the untarring direcotry or not. And yes I have run make install. Thanks guys I'll keep all that in mind.
  5. Phantasm66

    Phantasm66 TS Rookie Posts: 5,734   +8

    linux does not really include a nice and clean uninstallation function like windows does, if you have installed from source anyway. You can of course uninstall RPMs from the command line with the -e switch, but there may be shared dependancy problems. As I said, there may be a "make uninstall" capability in the source code..
  6. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    If you have run 'make install', then check the program's documentation. A nice author also lets you do a 'make uninstall'.

    If so, you'd better keep the source directory to have a chance for a neat unistall later. Of course you could keep the .tar.gz file too - when you want to uninstall the program, just unpack and run 'make uninstall'. Does the same thing (unless the author of makefile is using some _very_ sick methods to do install and unistall in makefile).

    If you don't have the option of 'make uninstall', then check inside the makefile for 'make clean' maybe it removes the installed binaries too. If not, then uninstallation means deciphering from makefile every file copied during 'make install' and removing them one-by-one.

    It is useful to keep your sources in /usr/src or something like that, this way they're not in your way in home directory or wherever.
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...