Random Musings

Sporadic thoughts on tech, economics, business, finance and trading

How to check if unzip is installed in Linux?

,

To check if unzip is installed on a system that uses yum (e.g., CentOS, RHEL, or Fedora), follow these steps:

1. Check if the unzip command is available:

The quickest way to check if unzip is installed is to try running it:

unzip --version
  • If the command is installed, it will display the version information.
  • If not, you will see a message like command not found.

2. Check using yum list installed:

You can query yum to see if unzip is installed:

yum list installed unzip
  • If installed, the output will show the unzip package details.
  • If not, you’ll see something like:
  Error: No matching Packages to list

3. Use rpm to check for the package:

Another way to check is to use the rpm command:

rpm -q unzip
  • If unzip is installed, it will return the package name and version.
  • If not, it will output:
  package unzip is not installed

4. Install unzip if not found:

If unzip is not installed, you can install it using yum:

sudo yum install -y unzip

This will install unzip and any necessary dependencies. After installation, verify again using unzip --version.