How do you unzip files using SUSE?

Goal  You want to use unzip when you are using SUSE (either openSUSE or SUSE Linux Enterprise).

Background
The unzip character-based utility is useful for many reasons.  At the command line you can access compressed files that normally occupy little space on the disk.  Transferring .zip files is great for keeping network bandwidth utilization low.

Try this command to see if unzip is installed: unzip --version
AWS SUSE servers have unzip installed by default, but they have no man pages.

Part 1:  Installing Unzip
If the command cannot be found, use these commands:

sudo su -
zypper install unzip

If the above command does not work, (for example, you do not have access to the Internet, and your network has no Debian package repositories configured), go here to get a file:

http://software.opensuse.org/download.html?project=Archiving&package=unzip

To find the correct installation media (and choose the correct link from the website above), you need to determine the architecture.  To do this, use this command: cat /etc/*-release

The above command will tell you if you are using SUSE Linux Enterprise or openSUSE.  The buttons can be right clicked to copy the location (e.g., to use wget http://software.opensuse.org/ymp/Archiving/SLE_12_SP1/zip.ymp).  Otherwise you click "Grab binary packages directly" and then download the appropriate file to your workstation and transfer it over to the Linux machine (e.g., with SFTP or SCP).

Once you get the file over, install it with this command: zypper install /path/to/unzip.rpm

Part 2:  How to Use Unzip
Now that unzip is installed, you can use it with a command like this (assuming you have a file named foobar.zip):

unzip foobar.zip

The above command will decompress the contents while retaining a copy.  The extracted contents will be decompressed in the same directory you run the command in.  The files will not necessarily go to the directory where foobar.zip is (e.g., if you are in /root/ and run unzip /tmp/foobar.zip the extracted files will go into the /root/ directory).

Leave a comment

Your email address will not be published. Required fields are marked *