How to Install Zip and Unzip in Linux

Zip is a command-line utility tool used for compressing files and folders. Compression of files & folders enables faster and more efficient transfer, storage, and emailing of files and folders. On the other hand, unzip is a utility tool that helps you decompress files and folders.

Benefits of zipping files:

  • Save Disk Space – Compressed/zipped files take up less disk space, leaving you with more space to work with.
  • Faster File Transfers – Zipped files are easy to transfer, including uploading, downloading, and attaching them to an email.
  • Cross-Platform Support – You can easily decompress zipped files on Linux, Windows, and even Mac.

In this guide, we focus on how you can install the zip and unzip (archive utilities) on various Linux distributions, and walk you through the commands to get started.

How to Install Zip/Unzip in Debian/Ubuntu/Mint

For Debian-based distributions, install the zip utility by running the command.

sudo apt install zip

After installation, you can confirm the version of the zip installed using the command.

zip -v

For the unzip utility, execute a similar command as shown.

sudo apt install unzip

Again, just like zip, you can confirm the version of the unzip utility installed by running.

unzip -v

How to Install Zip/Unzip in RedHat/CentOS/Fedora

Just like on Debian distributions, installing zip and unzip utilities on RHEL-based distros is quite simple.

To install zip, simply execute:

sudo dnf install zip

For the unzip utility, install it by running:

sudo dnf install unzip

How to Install Zip/Unzip in Arch/Manjaro Linux

For Arch-based distros, run:

sudo pacman -S zip

For the unzip utility,

sudo pacman -S unzip

How to Install Zip/Unzip in OpenSUSE

On OpenSUSE, run the command below to install zip.

sudo zypper install zip

And to install unzip, execute.

sudo zypper install unzip

Basic Zip and Unzip Usage

Once installed, you can immediately start compressing and extracting files.

Create a zip archive:

zip archive.zip file1 file2 file3

Extract a zip archive:

unzip archive.zip

List the contents of a zip file without extracting:

unzip -l archive.zip

For more information, read our article that shows how to create and extract a zip files in Linux.

Common Errors and Fixes

Here are some common issues you may run into when using zip/unzip on Linux:

  • Error: zip: command not found or unzip: command not found, which means the utilities are not installed. You need to install them by following the installation steps for your Linux distro above.
  • Error: permission denied when compressing/extracting, which means you may be trying to zip or unzip files in a directory you don’t have access to. Use sudo or switch to a directory you own.
  • Error: End-of-central-directory signature not found, which usually happens when the zip file is corrupted or incomplete. Try downloading the file again or ask the sender to re-compress it.
Conclusion

For newer versions of Linux distros such as Ubuntu and RHEL, the zip and unzip utilities already come pre-installed, and you are good to go.

We covered how to install zip and unzip command-line tools on various Linux distributions, how to check if they are installed, and some basic commands to use them. With these utilities, compressing and extracting files becomes simple, fast, and cross-platform.

Two small things before you go

If something didn’t work on your setup, leave a comment and tell me which distro and version you’re on. I read every one, and most of these articles got better because a reader pointed out what was missing.

And if it did work, share it. TecMint has stayed free for 14 years because people pass these articles around, and that traffic is what pays for writing the next one.

Leave a comment
Get two free Linux courses

Learn the Linux basics with two free courses and join 34,000+ readers getting practical TecMint tutorials and selected Pro TecMint articles every week.

Pro TecMint
Get lifetime access for $99

If you want to go beyond the free tutorials, Pro gives you 18 courses, 5 ebooks, and every future course I add. One payment, lifetime access, no renewals.

James Kiarie
James Kiarie
Contributor
About the author

This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.