blogger templates blogger widgets
This is part of a list of blog posts.
To browse the contents go to

Packages in Linux

Packaging involves usually 2 processes - archiving and compressing.

Archiving - tar
tar is the name of the program used to collect many files into one larger file for distribution or archiving. It's also a file format.

To create a archive,

$ tar -cf archive.tar
$ ls Desktop echo Podcasts Videos archive.tar details.out examples.desktop Public

To list the contents of archive,

$ tar -tvf archive.tar
-rw-r--r-- onie/egroup 473 2011-06-10 12:23
-rw-r--r-- onie/egroup 357 2011-06-10 12:22

To extract contents of archive,

$ tar -xf archive.tar
$ ls | grep .sh

Compressing - gzip, bzip2, xz, lzip

Tar files are not compressed.
A tar file when compressed is commonly referred to as a tarball.

Note that the size of archive is more than the combined sizes of and
-rw-r--r-- 1 onie egroup 473 2011-06-10 12:23
-rw-r--r-- 1 onie egroup 357 2011-06-10 12:22
-rw-r--r-- 1 onie egroup 10K 2011-06-15 13:40 archive.tar

For compressing we use any of the following compression utility tools
  • Gzip (gzip is short for GNU zip, extension .gz)
  • Bzip2 (is a free and open source lossless data compression algorithm developed by Julian Seward, extension .bz2)
  • XZ (is a lossless data compression file format that uses the LZMA2 compression algorithm, extension .xz)
  • Lzip(extension .lz)
  • compress (extension .Z)

We will try using Gzip compression tool.

To compress,
$ gzip archive.tar
Check the file's size now,
-rw-r--r-- 1 onie egroup 523 2011-06-15 13:40 archive.tar.gz
To uncompress,
$ gzip -d archive.tar.gz
$gunzip archive.tar.gz

To install packages from source, read this tutorial: Install packages

No comments:

Post a Comment