Name
tar.gz and tar.bz2 Files
Packaged software files with names ending .tar.gz and .tar.bz2 typically contain source code that you’ll need to compile (build) before installation. Typical build instructions are:
List the package contents, one file per line. Assure yourself that each file, when extracted, won’t overwrite something precious on your system, either accidentally or maliciously:[21]
$ tar tvzf
package.tar.gz | less For gzip files $ tar tvjfpackage.tar.bz2 | less For bzip2 filesIf satisfied, extract the files into a new directory. Run these commands as yourself, not as root, for safety reasons:
$ mkdir newdir $ cd newdir $ tar xvzf
<path>/package.tar.gz For gzip files $ tar xvjf<path>/package.tar.bz2 For bzip2 filesLook for an extracted file named INSTALL or README. Read it to learn how to build the software, for example:
$ cd newdir $ less INSTALL
Usually the INSTALL or README file will tell you to run a script called
configurein the current directory, then runmake, then runmake install. Examine the options you may pass to theconfigurescript:$ ./configure --help
Then install the software:
$ ./configure
options$ make $ su Password:*******# make install
[21] A maliciously designed tar file could include an absolute file path like /etc/passwd designed to overwrite your system password file.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access