(gs):Install a local copy of tar
- This page was last modified on May 11, 2011, at 02:15.
From (mt) Community Wiki
Contents |
The tar program is a great program. It archives files, it unarchives files, one could go so far as to say it's a cornerstone of the Unix/Linux world. "Tar is great," you might be saying to yourself, "but I need a newer version than what comes on my (gs) Grid-Service, one with more fiddly bits."
Fellow reader, you are in luck! A local copy of tar can indeed be built on your server, quite easily in fact. Read on to unlock the secrets of doing such a thing!
Important Information before proceeding
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications or code is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
This article assumes the user is comfortable with SSH and understands how to build programs via SSH.
Instructions
Coming soon
- Log into your server via SSH, use wget to download the latest release (1.26 as of this writing), unarchive it, and change into the tar-1.26 directory:
wget http://ftp.gnu.org/gnu/tar/tar-1.26.tar.gz tar -zxvf tar-1.26.tar.gz cd tar-1.26
- On dedicated servers, one could just run ./configure by itself, and move ahead. Since we are on a shared-service, we need to define the absolute path to the directory where the binary will be installed after it is compiled. This requires we visit the (gs) Grid-Service "Server Guide" inside the AccountCenter. Look for a section called "cluster", and take note of the following:
- Site Number
- Grid Cluster
- Storage Segment
- Now that we have our information, we can start the installation. For example, if you are on Grid Cluster 1 (c01), Storage Segment 23 (h23), Site Number 456, and you want to use the data/tar directory, you would enter the following commands:
./configure --prefix=/nfs/c01/h23/mnt/456/data/tar make make install
Of course, your numbers and directories will be different, but I suggest sticking with the data/tar directory. It will take a few minutes to fully compile and build the program, so go grab something to drink, or check out what's on TV.
- With your custom-built version of tar compiled and installed, you need to configure your SSH shell to use your local copy, instead of the server version. A quick one line command will take care of this:
echo "alias tar='~/data/tar/bin/tar'" >> ~/.bash_profile
With this done, log out of SSH and log back in, then run tar --version to make sure it's working. If it is, you will see the below:
tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason.
- ♪ Celebrate, because you are done! ♪