How to Install 7-Zip on Debian 12, 11 or 10

7-Zip is a widely used open-source file archiving software with high compression ratios and supports multiple file formats. It’s a valuable tool for desktop and server users, especially Debian Linux users. Below are some of the key features that make 7-Zip a popular file archiver option:

  • High Compression: 7-Zip offers excellent compression ratios, making it helpful in reducing file sizes and saving disk space.
  • Supports Multiple Formats: The software can handle various file formats, such as ZIP, RAR, and TAR, making it versatile for different archiving needs.
  • Secure Encryption: 7-Zip provides strong AES-256 encryption, offering a secure way to protect sensitive files.
  • Command-Line Interface: For those who prefer automation or need advanced features, 7-Zip offers a robust command-line interface.
  • Free and Open-Source: Being open-source, 7-Zip is freely available for modification and distribution.
  • Cross-Platform: 7-Zip works on Windows, Linux, and macOS, making it a flexible choice for different operating systems.

In summary, 7-Zip is a robust and versatile file archiving and compression tool. Whether you’re looking to save space, secure files, or work across different platforms, 7-Zip has features to meet your needs. The following guide will detail the steps to install 7-Zip on Debian Linux, covering Debian 12 Bookworm, Debian 11 Bullseye, and Debian 10 Buster. We’ll explore two installation methods using the command line terminal.

Update Debian Before 7-Zip Installation

Before installing 7-Zip, run a quick update to ensure all your system packages are up to date and to avoid potential issues.

sudo apt update

Use the given command to start the upgrade process if any updates are available.

sudo apt upgrade

Download and Install 7-Zip via Terminal Commands

The main method for installing 7-Zip on Debian Linux is to download the 7-Zip binary. You need to visit the official website of 7-Zip, select the appropriate version and architecture of the 7-Zip binary compatible with your system, and save it to your computer. Once the download is complete, you need to move the binary file to the appropriate location on your system, where it can be executed.

Download 7-Zip using the wget command below.

## example wget command only; do not copy ##
wget https://www.7-zip.org/a/7z2201-linux-x64.tar.xz

Note: Remember that the command above is an example, and the version and architecture of 7-Zip you download may vary depending on your system’s specifications. Different variants of 7-Zip are available for different architectures.

Once the download is complete, extract the archive. Then, you can open the downloaded tar file using the following command.

tar xf 7z2201-linux-x64.tar.xz

After extracting the tar file, you will find the 7-Zip binary named 7zz. You can now run 7-zip on Linux using the following command.

./7zz

When you use 7zip from a different working directory, you must provide the full path to the binary. To avoid this issue, add the binary to the /usr/local/bin directory to make it accessible system-wide.

mv 7zz /usr/local/bin

You can now access 7-Zip from any location on your filesystem using the 7zz command by adding the binary to the /usr/local/bin directory.

Basic Usage of 7-zip Commands

After installing 7-Zip on your Debian Linux system, you can manage archives directly from the command line. Below are five practical examples of tasks you can perform with 7-Zip.

Note: If you are familiar with the free, open-source version of 7-Zip available in Debian’s default repository, be aware that the below commands differ. Do not mix commands from different guides.

Compressing a file:

To compress a file, you can use the following command.

7z a archive.7z file.txt

Extracting a file:

You can use the following command to extract a file from an archive.

7z x archive.7z

Listing the contents of an archive:

To view the contents of an archive, you can use the following command.

7z l archive.7z

Adding files to an existing archive:

You can use the following command to add more files to an existing archive.

7z u archive.7z file2.txt

Extracting files with full path:

You can use the following command to extract files with their full path.

7z x archive.7z -o/path/to/extract/

These are just a few examples of the many tasks you can perform with 7-Zip’s command-line interface.

Conclusion

In summary, 7-Zip is a valuable tool for managing and securing files on Debian Linux. It can be easily installed using the apt package manager or by downloading the binary and moving it to the /usr/local/bin directory. With 7-Zip, you can compress and extract files in various formats, achieve high compression ratios, encrypt sensitive files and data, automate tasks, and perform complex operations. Whether you are using Debian on a desktop or server, 7-Zip is a powerful and versatile file archiving and compression tool that can be used for many tasks.

Leave a Comment