How to Install Bzip2 on Ubuntu

Bzip2 is an open source data compression algorithm first released in 1996. It offers better file compression than older algorithms such as LZW and Deflate, but is slower as a trade off. Bzip2 is purely a file compressor. It does not have built-in archive facilities, but you can use bzip2 with an archive tool such as tar to compress multiple files. A bzip2 package is available from the Ubuntu package repository, for easy installation on Ubuntu Linux using the apt tool.

...
Use Bzip2 compression to save space on the computer's hard disk.

Step

Log in to the remote Ubuntu server through SSH, or open a terminal window if you are running the Ubuntu desktop.

Step

Type "sudo apt-get update" at the terminal prompt to update the local package list with the latest data from the repository. Enter your password when requested by the sudo command.

Step

Type "sudo apt-get install bzip2" to download and install the bzip2 package from the Ubuntu package repository. The required files are small, so installation is quick to complete.

Step

Type "bzip2 -c filename > compressed.bz2" to compress a file named "filename" into the compressed file "compressed.bz2."

Step

Type "bunzip2 compressed.bz2" to decompress the file named "compressed.bz2." The decompressed file has the same name as the compressed file without the ".bz2" extension.