Choose a different version or distribution
Introduction
Before we begin talking about how to install 7-Zip on Ubuntu 22.04, let's briefly understand – What is 7-Zip?
7-Zip is a popular file compression software that allows you to reduce the size of large files and folders. It supports various archive formats including ZIP, RAR, and ISO, making it versatile and widely used among computer users. With its user-friendly interface, 7-Zip provides a simple and efficient way to compress and decompress files, saving storage space and enabling easier file sharing.
This free, open-source software offers high compression ratios and strong encryption capabilities, ensuring data integrity and security. 7-Zip is compatible with multiple operating systems and offers a command-line interface, making it a reliable choice for both beginners and advanced users.
In this tutorial, you will install 7-Zip on Ubuntu 22.04. We will also address a few FAQs on how to install 7-Zip on Ubuntu 22.04.
Advantages of 7-Zip
- High Compression Ratio: 7-Zip offers excellent file compression, reducing the size of files significantly.
- Versatile Format Support: It can handle various archive formats, including ZIP, RAR, and ISO.
- User-friendly Interface: The software provides a simple and intuitive interface, making it easy to use.
- Strong Encryption: 7-Zip ensures data security with robust encryption capabilities.
- Free and Open Source: It's a free software, available to everyone, with continuous community-driven development.
Install 7-Zip on Ubuntu 22.04 LTS Linux
Other Ubuntu versions, such as 20.04/18.04, as well as Debian, Linux Mint, POP_OS, Elementary OS, and other comparable Linux distributions, can be used with the instructions provided here.
Perform a System update
As we will be using the APT package manager and the system default source repository in this tutorial, make sure to first run the system update command to rebuild and refresh the cache.
sudo apt update
Install 7-zip on Ubuntu 22.04 LTS
For the latest version:
The most recent version of 7-Zip Linux is available for download straight from the program's official website. To install the desired version, navigate to the Download link and execute a right-click on it. As the screenshot illustrates:
Next, open the Ubuntu command terminal and download it using the wget tool and the copied link.
Syntax:
wget -O 7z paste-the-link
Example:
wget -O 7z.tar.xz https://www.7-zip.org/a/7z2301-linux-x64.tar.xz
After downloading, open the folder and extract the files:
tar -xf 7z.tar.xz --one-top-level
To move the executable to the /usr/local/bin folder, switch to the folder now.
cd 7z
Copy the executable file:
sudo cp 7zz /usr/local/bin/7z
To verify the version type:
7z -h
Regarding the edition accessible via the system repository by default:
Although we can install 7-zip using Ubuntu's default repository, it is not the most recent version. Nevertheless, it can be installed without the need for a third-party repository. Therefore, all you need to do is execute the provided command to install the entire 7-zip package using the APT package manager.
sudo apt install p7zip-full
To verify the version and available options, run:
7z -h
7Zip Command line to compress files
Using 7Zip, you can quickly create archive files in the terminal by using the following command-line method:
7z a folder-name.7z folder-name
Thus, the command would look like this, for instance, if we say that the folder name we want to compress is "pics".
7z a pics.7z pics
Use that extension to use any other archive format; for instance, to obtain the archive in zipped format, run the following command:
7z a pics.zip pics
To List the content of the file
Using the following command syntax, you can view the contents of an archive without extracting it:
7z l Archive-file-Name
Export files
Use the following command to export all files to a folder without preserving the folder structure.
7z e -y ArchivName.7z -o [TargetFolder]
Creating an archive – Example of highest compression:
The specified 7-zip command syntax is available to those who wish to manage the file's level of compression.
7z u -mx=9 ArchivName.7z FolderToCompress/*
-mx=9
, where 9 is the maximum compression you can apply if necessary.
Create an Archive with a password
For the file or folder you are compressing, would you like to create a password? Then, with 7-zip, that is also feasible. The command syntax is as follows:
7z a archivefile.7z target-folder -p
Note:
The file name you want to use for your compressed folder is archivefile.7z; feel free to use any other 7z extension that 7-zip is compatible with.
Target folder – It's the system file or folder that you wish to archivalize or compress.
FAQs to Install 7-Zip on Ubuntu 22.04
Does 7-Zip work on both 32-bit and 64-bit versions of Ubuntu 22.04?
Yes, 7-Zip is compatible with both 32-bit and 64-bit versions of Ubuntu 22.04.
How can I compress files and folders using 7-Zip?
Right-click on the desired file or folder, select the "7-Zip" option, and choose "Add to archive." Set the desired compression settings and click "OK" to create the compressed file.
Can I extract files from a 7-Zip archive on Ubuntu 22.04?
Yes, simply right-click on the archive file, choose the "7-Zip" option, and select "Extract Here" to extract the files.
Can 7-Zip handle password-protected archives?
Yes, 7-Zip supports password-protected archives. When extracting or creating an archive, you can set a password to secure your files.
What other archive formats does 7-Zip support?
Apart from the default 7z format, 7-Zip supports various formats, including ZIP, RAR, TAR, GZIP, and more.
Does 7-Zip have a graphical user interface (GUI)?
Yes, 7-Zip provides both a command-line interface and a GUI. You can use the GUI by opening the 7-Zip application from the system menu.
Can I integrate 7-Zip with the file manager on Ubuntu 22.04?
Yes, 7-Zip provides integration with most file managers on Ubuntu. Right-clicking on files or folders will show options to compress or extract using 7-Zip.
Is 7-Zip free and open source?
Yes, 7-Zip is free and distributed under the GNU Lesser General Public License. It is open source, meaning you can modify and distribute the source code freely.
Conclusion
We hope this tutorial helped you understand how to install 7-Zip on Ubuntu 22.04.
If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.