> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Use 7Zip in Ubuntu and Other Linux
- URL: https://itsfoss.com/use-7zip-ubuntu-linux/
- Published: 2019-05-10T16:00:22.000Z
- Updated: 2023-10-22T07:04:20.000Z
- Description: Cannot extract .7z file in Linux? Learn how to install and use 7zip in Ubuntu and other Linux distributions.
- Author: Abhishek Prakash
- Tags: Quick Tip

[7Zip](https://www.7-zip.org/?ref=itsfoss.com) (properly written as 7-Zip) is an archive format hugely popular among Windows users. A 7Zip archive file usually ends in .7z extension. It’s mostly an open source software, barring a few parts of the code that deals with [unRAR](https://itsfoss.com/use-rar-ubuntu-linux/). 

The 7Zip support is not enabled by default in most Linux distributions. If you try to extract it, you may see this error:

🚧

***Could not open this file type**  
***There is no command installed for 7-zip archive files. Do you want to search for a command to open this file?**

![There is no command installed for 7-zip archive files](https://itsfoss.com/content/images/wordpress/2015/07/Install_7zip_ubuntu_1.png)

Don’t worry, you can easily install 7zip in Ubuntu or other Linux distributions.

The one problem you’ll notice if you try to use the [apt-get install command](https://itsfoss.com/apt-get-linux-guide/), you’ll see that there are no installation candidates that start with 7zip. It’s because the 7Zip package in Linux is named [p7zip](https://sourceforge.net/projects/p7zip/?ref=itsfoss.com), starting with the letter ‘p’ instead of the expected number ‘7’.

Let’s see how to install 7zip in Ubuntu and (possibly) other Linux distributions.

## Install 7Zip in Ubuntu Linux

The first thing you need is to install the p7zip package. You’ll find three 7zip packages in Ubuntu: 

- p7zip
- p7zip-full
- p7zip-rar.

The difference between *p7zip* and *p7zip-full* is that *p7zip* is a lighter version providing support only for .7z while the full version provides support for more 7z compression algorithms (for audio files etc.).

The p7zip-rar package provides support for [RAR files](https://itsfoss.com/use-rar-ubuntu-linux/) along with 7z.

Installing *p7zip-full* should be sufficient in most cases, but you may also install *p7zip-rar* for additional support for the RAR file.

p7zip packages are in the [universe repository in Ubuntu](https://itsfoss.com/ubuntu-repositories/) so make sure that you have enabled it using this command:

```
sudo add-apt-repository universe
sudo apt update
```

Use the following command to install 7zip support in Ubuntu and Debian based distributions.

```
sudo apt install p7zip-full p7zip-rar
```

That’s good. Now you have 7zip archive support in your system.

## Extract 7Zip archive file in Linux

With 7Zip installed, you can either use the GUI or the command line to extract 7zip files in Linux.

In the terminal, you can extract a .7z archive file using this command:

```
7z e file.7z
```

![Extracting a 7z file in Linux terminal.](https://itsfoss.com/content/images/2023/10/extract-from-7z.svg)

Extracting a 7z file

In the GUI, you can extract a .7z file as you extract any other compressed file. You right-click on the file and proceed to extract it.

![Extract 7z File using Nautilus file manager.](https://itsfoss.com/content/images/2023/10/Extract-7z-using-GUI.png)

Extract 7z File using GUI

## Compress a file in 7zip archive format in Linux

You can also use the command line, if it suits you, for this purpose:

```
7z a OutputFile files_to_compress
```

![Create 7z archive file by compressing several files in Linux terminal.](https://itsfoss.com/content/images/2023/10/compress-to-7z.svg)

Compress Files to 7z

By default, the archived file will have .7z extension. You can [compress the file in zip format](https://itsfoss.com/linux-zip-folder/) by specifying the extension (.zip) of the output file.

![Compress files to ZIP archive by specifying the extension in output file.](https://itsfoss.com/content/images/2023/10/compress-to-zip.svg)

Compress to ZIP

You can compress a file in 7zip archive format graphically. Right-click on the file/directory, and select **Compress**. You should see several types of archive format options. Choose .7z for 7zip.

![Create 7zip Archive Ubuntu using GUI.](https://itsfoss.com/content/images/2023/10/create-7z-archive-GUI.png)

7zip Archive Ubuntu

## Conclusion

That’s it. See how easy it is to use 7zip in Linux. I hope you liked this quick tip. 

Similarly, you can [use RAR files in Linux](https://itsfoss.com/use-rar-ubuntu-linux/).

[How to Use RAR files in Ubuntu Linux \[Quick Tip\]Looking for WinRAR in Linux? Here’s how to extract and use RAR files in Linux. RAR is a quite good archive file format. But, it isn’t the best when you’ve got 7-zip in Linux offering great compression ratios and Zip files being easily supported across multiple platforms![](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)It's FOSSAnkush Das![](https://itsfoss.com/content/images/wordpress/2018/09/rar-ubuntu-linux.png)](https://itsfoss.com/use-rar-ubuntu-linux/)

If you have questions or suggestions, feel free to let me know in the comment sections.