How To Install 7-Zip on Debian 12
In this tutorial, we will show you how to install 7-Zip on Debian 12. 7-Zip is an open-source file compression and archiving utility known for its high compression ratio and support for multiple file formats. It offers a user-friendly interface and command-line support, making it suitable for both novice and advanced users. With 7-Zip, you can compress files into archives, extract files from existing archives, and even create self-extracting archives.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of 7-Zip on a Debian 12 (Bookworm).
Prerequisites
- A server running one of the following operating systems: Debian 12 (Bookworm).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for 7-Zip.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install 7-Zip on Debian 12 Bookworm
Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt
commands in the terminal:
sudo apt update && sudo apt upgrade
This command will refresh the repository, allowing you to install the latest versions of software packages.
Step 2. Installing 7-Zip on Debian 12.
- Method 1: Install 7-Zip using binary:
Now download the 7-Zip binary from the official website using the following command:
curl -O https://www.7-zip.org/a/7z2301-linux-x64.tar.xz
Extract the downloaded file using the following command:
tar -xf 7z2301-linux-x64.tar.xz
Move the extracted files to the appropriate location on your system using the following command:
sudo mv 7z2301-linux-x64 /usr/local/
Add the 7-Zip binary to your system’s PATH by running the following command:
echo 'export PATH=$PATH:/usr/local/7z2301-linux-x64' >> ~/.bashrc
Refresh your terminal by running the following command:
source ~/.bashrc
Finally, you can now use 7-Zip by running the 7z
command in the terminal.
- Method 2: Install 7-Zip using the package manager:
To install 7-Zip, run the following command in the terminal:
sudo apt install p7zip-full
Once the installation is complete, you can verify 7-Zip by executing the following command:
7z --version
Step 3. Utilizing 7-Zip on Debian 12 Bookworm.
With 7-Zip installed, let’s explore some practical examples of using this powerful tool:
- Creating an Archive:
To create an archive, use the following command:
7z a [archive_name.7z] [file/directory]
Replace [archive_name.7z]
with the desired name for your archive, and [file/directory]
with the file or directory, you want to compress.
- Extracting Files:
To extract files from an archive, use the following command:
7z x [archive_name.7z]
Replace [archive_name.7z]
with the name of the archive, you want to extract.
- Testing the Integrity of an Archive:
To check the integrity of an archive, use the following command:
7z t [archive_name.7z]
Replace [archive_name.7z]
with the name of the archive, you want to test.
Step 4. Integrating 7-Zip with the File Manager.
Integrating 7-Zip with the file manager on Debian 12 Bookworm allows you to perform archive-related tasks more conveniently. Here’s how you can integrate 7-Zip with the default file manager:
sudo apt install p7zip-gui
After the installation, restart your file manager to enable the integration. Once the integration is complete, you can right-click on files or directories to access various 7-Zip options, such as creating archives, extracting files, and testing archive integrity.
Step 5. Troubleshooting Tips.
Encountering issues during the installation or usage of 7-Zip? Here are a few troubleshooting tips:
-
Permission Denied: If you receive a “permission denied” error, ensure that you are executing the installation command with administrative privileges using the
sudo
command. -
Update Package Repositories: If you encounter errors related to package repositories during the installation, update your repositories using the command
sudo apt update
and try again. -
File Format Compatibility: If you come across compatibility issues while working with specific file formats, ensure that the file format is supported by 7-Zip. Refer to the official 7-Zip documentation or online resources for a complete list of supported formats.
Congratulations! You have successfully installed 7-Zip. Thanks for using this tutorial for installing the latest version of 7-Zip on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official 7-Zip website.