About | Home | Search


HOWTO: tar
Description: The GNU version of the tar archiving utility
Click here for ChangeLog
NOTE: it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU tar 1.18
# ============
# Slackware 9.0 and 9.1's 'tar' packages include version 1.13.25, 10.0's
# includes 1.14, 10.1, 10.2, and 11.0's include 1.15.1, 12.0's includes
# 1.16.1

# Prerequisites:
# gzip
# bison
# gettext
# libiconv

# If ftp.gnu.org is busy, try ibiblio instead

# This will clean up old versions of tar and will create the necessary
# directories for installing everything below.  If you're replacing a
# Slackware-installed tar package, removing that package will leave a
# /bin/tar binary behind, because it's called 'tar-incoming' in the package.
su
test -x /sbin/removepkg && /sbin/removepkg tar
find /usr/local/src -maxdepth 1 -type d -name "tar-*" -exec rm -r {} \;
find /usr/share/locale -type f -name "tar.mo" -exec rm {} \;
mkdir -p -m 0700 ~/installed ~/src
exit

# Below we use the shar (SHell ARchive) format instead of .tar.gz or
# .tar.bz2, that way you don't need to already have tar installed to install
# tar.  You'll need gunzip to decompress the shar.gz file, and the shar file
# itself requires uudecode.  uudecode is part of the GNU sharutils package.
# If you have gmime installed, be aware that the 1.13 and 1.14 shar files
# failed to decompress (it hung on certain files) for me with gmime's version
# of uudecode.  I removed the temporary directory (_sh?????) that it left
# behind, I temporarily renamed uudecode to uudecode.old, copied the
# sharutils version from another box, and then it decompressed successfully
# (then restored the gmime version of uudecode).

# Here we install tar 1.13, patched to add bzip2 (-y) support.  This
# particular version is used by the Slackware package utilities.

# Not sure why, but I was unable to build this on one Slackware 11.0
# machine, but was able to build it on a Slackware 9.1 machine (both
# far from stock Slackware).
# If you have trouble building it too, here's a binary:
# http://englanders.cc/pub/linux/misc/tar-1.13
# Install it as /bin/tar-1.13

cd
test -f installed/tar-1.13.shar.gz && mv installed/tar-1.13.shar.gz .
test ! -f tar-1.13.shar.gz &&
 wget http://ftp.gnu.org/gnu/tar/tar-1.13.shar.gz
cd src
test -d ./tar-1.13 && rm -r ./tar-1.13
zcat ~/tar-1.13.shar.gz | sh
cd tar-1.13
test $UID = 0 && chown -R root:root .
chmod -R u+w .
wget -nc http://englanders.cc/pub/linux/patches/notmine/\
tar-1.13-bzip2.diff &&
 patch -p0 < tar-1.13-bzip2.diff
./configure --prefix=/usr --disable-nls
make

# Install it (as root)
su -c "install -s src/tar /bin/tar-1.13"

# This is the current version:
cd
test -f installed/tar-1.18.tar.bz2 && mv installed/tar-1.18.tar.bz2 .
test ! -f tar-1.18.tar.bz2 &&
 wget http://ftp.gnu.org/gnu/tar/tar-1.18.tar.bz2

# Verify tarball w/ md5sum:
echo "70170208d7c1bb9ab40120579434b6a3  tar-1.18.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "5b5078cb291492ffeb4fb134179fc6ffd2121c66  tar-1.18.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 55D0C732 > /dev/null 2>&1 || gpg --recv-keys 55D0C732 ) &&
 wget -nc http://ftp.gnu.org/gnu/tar/tar-1.18.tar.bz2.sig &&
 gpg --verify tar-1.18.tar.bz2.sig && rm tar-1.18.tar.bz2.sig

cd src
/bin/tar-1.13 xyvf ~/tar-1.18.tar.bz2
cd tar-1.18
test $UID = 0 && chown -R root:root .
./configure --prefix=/usr --disable-nls --enable-backup-scripts
make

# Become root to install it
su

make install-strip
mv -f /usr/bin/tar /bin/
ln -sf /bin/tar /usr/bin/tar
ln -sf /usr/libexec/rmt /etc/rmt
ln -sf /usr/libexec/rmt /sbin/rmt

# Become yourself again
exit

# Remove old version tarballs, put the installed ones in ~/installed/:
cd
rm -f installed/tar-*.tar* installed/tar-*.shar*
mv tar-1.13.shar.gz tar-1.18.tar.bz2 installed/

# You may want to check out the relatively new backup and restore scripts
# in /usr/sbin.  Run each one with "--help" for usage information.

Back to the list


Last updated: Fri, 26 Mar 2010 13:18:56 -0400
Jason Englander <jason at englanders dot us>