Handling Compressed Archives with Ubuntu (Linux)
I recently read an article by the venerable +Make Tech Easier (who I recommend all Google+ users consider following) that discussed the handling of self-extracting archived (compressed) files in Windows, Ubuntu (Linux), and Mac. The article was okay, and didn't have many flaws really, just that I didn't agree with some of what they had to say about Ubuntu. Allow me to offer some alternative suggestions. This article is intended for users who are new to using Ubuntu, or for those who just really haven't given archived files much thought. Also, it's important to note that it is my intention to show only the pointy-clicky methods using the graphical user interface (GUI). Leave the command-line stuff for another day.Here's where +Make Tech Easier is was correct, although I am not entirely convinced this is relayed clearly in their article: A self-extracting archive is actually a Decompression program tacked on to the beginning of the compressed file, and it is this way for any operating system. This is important because executable programs are different for each operating system (except for certain situations like Java). What does this mean to the end-user? As far as I know, there is currently no built-in pointy-clicky capability for Windows to create a self-extracting archive that will behave on Ubuntu or Mac in the same way it does on Windows. And conversely, there is no pointy-clicky method of making a self-extracting archive behave on Windows the way you'd expect it to. For this, you can see their original article http://www.maketecheasier.com/create-self-extracting-archives-without-installing-software/2013/08/05 and scroll down to the Ubuntu section.
Now, I did read on feature list of the software I am going to reference a lot in this article (File-Roller) that they support creating self-extracting zip files. I have never done this, and will edit this article as soon as I nail down how to. I assume it's simply a matter of clicking on menu options, but I will clarify that as soon as I can.
From File Roller's News Page http://fileroller.sourceforge.net/news.html
File Roller 2.23.4
Changes since previous version:
New features and user visible changes
- Added support for reading and extracting alz archives (#521324).
- Added support for rzip compressed files (#503000).
- Added support for creating self-extracting zip archives.
- ....
Basic Ubuntu Technical Information as it Applies to This Article
Just to make sure I avoid going anyone's heads here, I am going to try to address some small details that Ubuntu veterans take for granted these days. If I glaze over something that you would like more information about, please feel free to fire me a note and I will make corrections and clarifications.
- Ubuntu's default File Manager is called Nautilus. The MS Windows equivalent is called Windows Explorer. If you are using a different flavour (distribution) of Linux, you may have a differently named File Manager. They all behave essentially the same, with some key differences that make some more popular than others. This article is not going to address the other File Managers at this time.
- Ubuntu's default Archive Manager is called File Roller. It has been a long time since I spent any time using Windows, so I don't know if it comes with a default archive manager. There are several different archive management software packages out there (eg. WinRAR, WinZip, etc), but you do not need any of those in Ubuntu.
- Some people like to use the command line (Terminal, or CLI) for doing a lot of things in Linux, and this includes Ubuntu. It's important to note that most common and intermediate tasks can be handled without using the command line at all. This includes handling archived and compressed files. You may choose, at some point, to use the command line for these purposes because it can be faster than the pointy-clicky method, but people really need to understand that it is not a requirement.
How to View the Contents of a Compressed Archive With Ubuntu
This is exceedingly simple. Any standard compressed archive (.zip, .7zip, .tar.gz, .jar, and so on), regardless of what operating system was involved in its creation, can be viewed in Ubuntu simply by navigating to where the file is located and double-clicking on it. It is commonly your Downloads folder which can be found by right-clicking on the Home icon on the Launch Panel on the left side of your screen, and choosing Downloads. The scope of this tutorial does not cover the basics of using the File Manager (Nautilus) or the search scope lens on Ubuntu's panel. Once you have tracked down the file in question, you can view its contents simply by double-clicking on the file. This will launch the Archive Manager (File Roller), and display the contents of the archived file as if it were a folder.
Once you are viewing the file, you can interact with the contents in a number of ways. You may be able to choose individual files from the contents to extract (or decompress), you may be able to view the content files as if they were regular files in a folder, and so on.
How to Extract (Decompress) All of the Contents of a Compressed Archive
As with viewing the contents, this is also a trivial matter for all standard compressed archives. Simply navigate to the file, right click on it, and choose Extract Here. This will create a folder of the same name as the archive (or a pre-determined folder name as outlined by the originator of the archive), and decompress all the content files and place them within the created folder. All of the files will follow the original file hierarchy, unless the originator of the archive specified something different when the archive was created.
What if it's a Non-Standard Archive Format?
In most cases, such as the ubiquitous .rar file format, there is a simple way to install the required libraries to handle your particular archive format. Simply open the Software Center by clicking on the Ubuntu Software Center icon on your launch panel. In the search field at the upper-right corner, type in the extension of your archive (eg. .rar) and browse the list of options. Keep in mind that the first option may not be the best one ... feel free to read the reviews of the packages and choose the ones that seem most likely to fit your needs. It's also generally harmless to install packages that you don't end up using. Some of the packages may handle multiple file formats. Once the package has been downloaded and installed by the Software Center, you should be able to continue with this tutorial as if you were handling a standard archive. In some cases, double-clicking the file will now open it with an alternative archive manager, but most of them behave in a similar manner.
How to Create a Compressed Archive
Navigate to the file or folder you would like to compress. Right click on that file, then choose Compress. This will open a simple dialogue where you can choose a name for the compressed file, the type of compression such as the standard tar.gz (we won't discuss the pros & cons of various compression formats in this article), the final location, and other options such as passwords & encryption. Hit Create and the computer will do the rest!
A Note About Self-Extracting Archives
In Ubuntu (and most distributions of Linux), you do not need to use self-extracting archives because archives are extremely well-supported. If you are simply compressing and handling archives for your own personal use, or for the use of someone else with a similar operating system, then just sticking with default options is usually totally sufficient.
Opening a previously created self-extracting archive can be done by right-clicking the file and selecting Open With, and choosing File Roller or Archive Manager.
I will add pointy-clicky methods of making self-extracting archives as soon as I have nailed it down. One method that looks promising is to use the software package called Xarchiver ... there is a menu option for creating self-extracting files. I have yet to try it out.
That's it for now. Please contact me at +Michael Ireland if you have any comments.