Home  »  ArticlesGuidesHow ToTechnologyTools   »   How to Install 7-zip on Ubuntu 20.04 | Debian

How to Install 7-zip on Ubuntu 20.04 | Debian

In this tutorial, we will be showing you how to install 7-zip on Ubuntu 20.04 and Debian-based Linux systems. To perform the actions in this guide you will need to make sure you are logged in as a user with sudo privileges.

7-Zip is a free, cross-platform, and open-source software used for packing and unpacking files and folders into a variety of formats. These include 7z, XZ, BZIP2, GZIP, TAR, ZIP, and WIM. The following file formats are only supported for unpacking; AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VHDX, VMDK, WIM, XAR, and Z.

7-Zip comes with a high compression ratio in 7z format with LZMA and LZMA2 compression algorithms.

Install 7-zip on Ubuntu 20.04 in Two Steps

Step 1: Update your Linux system to ensure you have the latest packages.

$ sudo apt update && sudo apt upgrade

Step 2. Install 7-zip archiver on the Ubuntu system.

$ sudo apt install p7zip-full p7zip-rar

Use this command to confirm the successful installation, to see the list of commands and options.

$ 7z

How to Use 7-zip on Ubuntu and Debian Based Systems

The syntax for running commands in 7-zip is as follows:

7z <command>

This is the list of command options available with 7-zip.

b : Benchmark
d : Delete files from archive
e : Extract files from archive (without using directory names)
h : Calculate hash values for files
i : Show information about supported formats
l : List contents of archive
rn : Rename files in archive
t : Test integrity of archive
u : Update files to archive
x : eXtract files with full paths

Examples of 7-zip Commands syntax are shown below:

Create and add files to an archive:

$ 7z a [archive name] [file/directory]

Unpack a 7zip file:

$ 7z e [archive name]

View the contents of an archive:

$ 7z l [archive name]

Conclusion

We have shown you how to install 7-zip on Ubuntu 20.04 and now you should be able to compress and decompress files using the 7-zip utility. More details about the utility can be found here.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

Available under:
Articles, Guides, How To, Technology, Tools