How to Install 7-Zip on Debian 11 or 10


7-Zip is a popular open-source file archiving and compression software that allows users to compress and extract files in various formats. It is a versatile tool that can be used on desktop and server environments and is particularly useful for users of Debian Linux. This software can save disk space, reduce file transfer times, and increase security by encrypting and password-protecting files.

Some of the key features and benefits of 7-Zip include:

  • High compression ratio: 7-Zip uses advanced compression algorithms to achieve high compression ratios, making it an ideal tool for compressing large files and reducing disk space usage.
  • Multi-format support: 7-Zip can handle many file formats, including ZIP, RAR, TAR, and many others. This makes it a versatile tool that can be used for a wide range of file archiving and compression tasks.
  • Strong AES-256 encryption: 7-Zip offers strong AES-256 encryption, considered one of the most secure encryption algorithms available. This makes it an ideal tool for encrypting sensitive files and data.
  • Command-line interface: 7-Zip includes a powerful command-line interface that allows users to automate tasks and perform complex operations.
  • Free and open-source: 7-Zip is free and open-source software, which means that it is available to anyone, and its source code can be modified and distributed.
  • Cross-platform compatibility: 7-Zip is compatible with Windows, Linux, and macOS, making it a versatile tool that can be used on various platforms.

These are just a few of the many features and benefits of 7-Zip, making it a powerful and versatile file archiving and compression tool that can be used for many tasks. This guide will show you two methods of installing 7-Zip on Debian 11 (Bullseye) or 10 (Buster) using the command line terminal.

Update Debian

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

sudo apt update

Before installing 7-Zip, ensure that all your system packages are up-to-date by running a quick update to avoid any potential issues.

apt list --upgradable

If any updates are available, use the given command to start the upgrade process.

sudo apt upgrade

Method 1: Install 7-Zip with APT

The first method for installing 7-Zip on Debian Linux is to use the apt package manager. This method is recommended for users who are new to Linux or prefer a more user-friendly installation process but is often outdated compared to the source version.

To install 7-Zip using apt, open a terminal window and enter the following command.

sudo apt install p7zip-full

This command will download and install the 7-Zip package and any dependencies that are required. Once the installation is complete, you can verify that 7-Zip is installed by running the following command.

7z

Method 2: Install 7-Zip Binary

The second 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 and select the appropriate version and architecture of the 7-Zip binary compatible with your system, then 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 the binary file can be executed.

This guide will now demonstrate the steps involved in using the latest version of 7-Zip, version 22.01 (2022-07-15), and the 64-bit Linux x86-64 architecture.

Download 7-Zip using the wget command below.

wget https://www.7-zip.org/a/7z2201-linux-x64.tar.xz

Please remember the command provided above is an example, and the version and architecture of 7-Zip you choose to download may vary depending on your system’s specifications. Different variants of 7-Zip are available for different architectures.

See also
How to Install Remi RPM on Rocky Linux EL9 or EL8

Example:

Once the download is complete, extract the archive. You can use the following command to open the downloaded tar file.

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 using 7zip from a different working directory, you’ll need to provide the full path to the binary. To avoid this issue, you can add the binary to the /usr/local/bin directory, making it accessible system-wide.

mv 7zz /usr/local/bin

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

Basic Usage of 7-zip commands

Once 7-zip is installed on your Debian Linux system, you can create and extract archives from the command line. Here are five examples of everyday tasks you can perform with 7-Zip.

Compressing a file:

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

7z a archive.7z file.txt

Extracting a file:

To extract a file from an archive, you can use the following command.

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:

To add more files to an existing archive, you can use the following command.

7z u archive.7z file2.txt

Extracting files with full path:

To extract files with their full path, you can use the following command.

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.

1 thought on “How to Install 7-Zip on Debian 11 or 10”

Leave a Comment

Share to...