Find the answer to your Linux question:
Results 1 to 9 of 9
I may actually move to slackware if someone can explain to me how tarballs work (currently i hate them, but only because i don't understand) There's nothing on the net ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2005
    Posts
    11

    How tarballs work


    I may actually move to slackware if someone can explain to me how tarballs work (currently i hate them, but only because i don't understand)

    There's nothing on the net that's actually useful. How do the files know where to go? And for each different distro? What is the command to make and install? and broken down? when it's made, where do the temp files go? what do the letters do in the tar program? what if you change them? is an uninstall record created? where is it kept?

  2. #2
    Linux Engineer rong's Avatar
    Join Date
    Feb 2005
    Location
    California
    Posts
    803

    Re: How tarballs work

    Quote Originally Posted by Somethin_Cool
    I may actually move to slackware if someone can explain to me how tarballs work (currently i hate them, but only because i don't understand)

    There's nothing on the net that's actually useful. How do the files know where to go? And for each different distro? What is the command to make and install? and broken down? when it's made, where do the temp files go? what do the letters do in the tar program? what if you change them? is an uninstall record created? where is it kept?
    Those are a *lot* of questions and more than I have the energy to try to answer all in one sitting

    Where the files go is coded within the file itself. Where you put the tar file in the first place is up to you. Normally you place in a directory of your choosing/making in your /home directory.

    Suggest you study the following if you have not already. Good place to start.
    Code:
    info tar
    registered Linux user #388382

    Have you checked here first?

  3. #3
    Just Joined!
    Join Date
    Jun 2005
    Location
    Ohio, USA
    Posts
    13

    Re: How tarballs work

    A "tarball" (*.tar.gz) is a GZipped *.tar file - or a compressed (GZipped) archive (Tar). You can think of them as a *.zip file.

    How do the files know where to go?
    - This is specified when they're created
    And for each different distro?
    - same for each distro
    What is the command to make and install?
    - depends on the source code contained therein, although it's usually the (./confiure, make, make install) method.
    and broken down?
    - what?
    when it's made, where do the temp files go?
    - there are none
    what do the letters do in the tar program?
    - xzvf is the usual usage: X= eXtract, z=gZip, v=Verbose, f=Filename what if you change them?
    - this is fine... it's just an archive
    is an uninstall record created?
    - not usually

    I think you're confused - *.tar.gz is NOT an installable file. It's a collection of text files known as source code. These are then compiled through the use of a Makefile contained therein to create the binaries, which are then simply placed wherever the author thinks they should've been.

    For more information, please see the following pages:
    http://unixhelp.ed.ac.uk/CGI/man-cgi?tar
    http://www.rt.com/man/gzip.1.html
    http://www.linuxquestions.org/questi...ticle&artid=15

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jun 2005
    Posts
    11
    Oh. Well that makes tarballs a bit rubbish unless there is a... program I can use to log and recall what's gone where for uninstall purpose?

    Can I do that? Uninstall is important.

  6. #5
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    Quote Originally Posted by Somethin_Cool
    Can I do that? Uninstall is important.
    usually
    Code:
    make uninstall
    uninstalles a program (you de this in the directorary you did
    Code:
    make install
    in. A usful link is http://www.linuxforums.org/tutorials...ial-19957.html if you wan to lean how to install tarballs.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  7. #6
    Just Joined!
    Join Date
    Aug 2004
    Location
    Croatia, Zagreb
    Posts
    70
    On Slackware there is also one program available for download called checkinstall which you can use to make the slackware package on the fly right after compiling the source found in the tarball and then install that newly created package.

    The advantage is that you can then remove that package with Slackware's package manager, pkgtool.

    EDIT: To install checkinstall download its slackware pack and run installpkg checkinstall-1.5.3.tgz (or if it's in other path, /path/to/checkinstall-1.5.3.tgz).

    The way you use checkinstall for that is simple. Instead of running the standard "make install" command after "make", you run "checkinstall -y".

    So, let's say you downloaded supertux source tarball. The latest version of it is called "supertux-0.1.2.tar.bz2". Here is how you install it with using checkinstall:

    Extract it:
    Code:
    tar xvjf supertux-0.1.2.tar.bz2
    Note that for tar.bz2 packs you use xvjf instead of xvzf for tar.gz ("j" is for bz2 and "z" is for gz).

    Go to the newly created (extracted) supertux directory:
    Code:
    cd ./supertux
    Configure and compile:
    Code:
    ./configure
    make
    Install using checkinstall:

    Code:
    checkinstall -y
    Check install will ask you which package to create. There are three choices, Slackware, Debian and RedHat RPM. You need Slackware, so choose "S".

    And that's pretty much it. The checkinstall command created a slackware .tgz pack (yes, reusable any time) and installed it with pkgtool which is why you can always uninstall it with pkgtool.

    So, with it, it doesn't matter if the source in tarball supports "make uninstall" or not. You can have full control over your new program with pkgtool, thanks to this great utility, checkinstall.

    Hopefully this helps somewhat

    Daniel

  8. #7
    Just Joined!
    Join Date
    Oct 2004
    Posts
    65
    Quote Originally Posted by Somethin_Cool
    Oh. Well that makes tarballs a bit rubbish unless there is a... program I can use to log and recall what's gone where for uninstall purpose?

    Can I do that? Uninstall is important.
    Uninstallation procedures aren't as important in Linux as they are in Windows. If the app was good enough to be installed, keep it then bi-god! :P

    Slackware has a very simple but powerful management tool known as pkgtool.



    From here you can use .tgz files (another type of tar archive) to install applications.

  9. #8
    Just Joined!
    Join Date
    Jun 2005
    Location
    Rancho Cucamonga, CA
    Posts
    3

    Tar-ball history

    ==== A quick bit of tarball history ====

    Original Unix machines did not have disk drives that could be used for backup, plus the only available portable medium was 3/4" tape drives (think a very big reel-to-reel precursor to 8-track/cassette tapes).

    In order to backup data/programs, a program was created (TAR - Tape ARchive) in order to transfer data/programs to the tape drive. Essentially, it's nothing more than a zip file (basically, a collection of files stored into a single file for portability/archive purposes). Back then, they did not have efficient compression algorithms, so they just "appended" the next file onto the tape. It wasn't until later that compression algorithms were introduced to reduce the amount of space required on the tape drive for backups.

    As is usual in old-system programs, memory and disk space was at a premium (plus having to remember long command names like "backup"), the program was named "tar".

    Also, Unix programmers tend to make many options available for each command, which reduces the number of programs that you need to remember, as well as combining common routines into a single program (reducing multiple programs combined size into a single program that doesn't take up much more room). This is why some programs have a lot of options available to them.

    If you look at a tarball (using "tar -tf <file>" where -t is "test/display contents of" and -f is "use the file <file> instead of the default tape archive device". If it's a compressed archive, use one of "'j' (bzip format) or '-z' (gzip) compression algorithms ), you will see a list of files that are saved. If you look at the output, you will notice that there is no leading slash, so when you unarchive the file, it will place files relative to where your current directory is (type "pwd" at the command prompt and you will see where you are at the moment). For example: (from the slackware 10.0 disk under 'extras' for the 2.6.9 kernel)

    ===========
    ken@ken:/home/ken $ tar -tzf kernel-generic-2.6.9-i486-1.tgz

    ./
    boot/
    boot/System.map-generic-2.6.9
    boot/config-generic-2.6.9
    boot/vmlinuz-generic-2.6.9
    install/
    install/doinst.sh
    install/slack-desc
    ===========

    The '.tgz' extension indicates that it's compressed using gzip.
    There are 3 files located in the boot/ directory
    There are 2 files located in the install/ directory

    If you run 'tar -zxvf kernel-generic-2.6.9-i486-1.tgz' using the command line, then these 2 directories (boot/ and install/) will be created from the current location, then the files will be extracted into those directories.

    The assumption is that you will know where to unarchive the files to - in this case, it's the actual kernel image for Linux version 2.6.9 (binary files), along with the standard Slackware doinst.sh shell script and slack-desk file to be used with the Slackware package manager.

    In summary, contrary to what one of the above posters indicated, a tar file is nothing more that a Unix version of a zip file - what it contains is completely up to whoever created the tar file.

    As far as the Slackware package manager, as long as the tarball is a correctly-archived package in the Slack package manager format, by running "installpkg <file>" or running "pkgtool" and selecting a proper Slackware tar archive, then you will have decent install/unistall capabilities.

    If you use a different install program (for instance, OpenOffice.org suite directly from OOo web site), then you have to rely on the installer from wherever you got the tarball from to also include an uninstall script/program.

    Hope this helps.

  10. #9
    Linux Engineer
    Join Date
    Mar 2005
    Location
    Where my hat is
    Posts
    766
    Quote Originally Posted by Somethin_Cool
    Oh. Well that makes tarballs a bit rubbish unless there is a... program I can use to log and recall what's gone where for uninstall purpose?

    Can I do that? Uninstall is important.
    There are no "uninstall" procedures for zip files either. A tarball is nothing more than a zip file you'd find in Windows.

    Now if you want to uninstall the program AFTER you've uncompressed it and installed, there are some excellent ideas already expressed in this thread.
    Registered Linux user #384279
    Vector Linux SOHO 7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •