This guide demonstrates how to install UNRAR on Linux Mint 21 or 20, using the UNRAR package directly from Linux Mint/Ubuntu’s default repository and the installation of the unrar-free package.
UNRAR is a powerful tool, integral to the Linux Mint ecosystem, widely recognized for its utility in managing compressed files. Predominantly used in server environments, UNRAR’s compatibility and functionality make it an indispensable resource for users, system administrators, and developers. Its ability to handle RAR files, a common format for data compression and archiving, is particularly valuable in Linux systems. The software offers a range of features, including:
- Efficient Compression: UNRAR excels at compressing large files, making it ideal for server use where storage optimization is critical.
- Cross-Platform Support: It supports a variety of file formats, ensuring versatility across different operating systems.
- Secure File Handling: With encryption and password protection capabilities, it provides secure management of sensitive data.
- Batch Processing: Automates the extraction of multiple archives, enhancing productivity for administrators and developers.
- Command-Line Interface: Offers a CLI for streamlined operations, critical in server environments where GUI might not be available.
Transitioning smoothly from its features, let’s delve into the technical aspects of installing UNRAR on Linux Mint. The process is straightforward and begins with accessing the Linux Mint/Ubuntu’s default repository. This approach ensures a seamless integration with the existing system setup and leverages the stability and security of official sources.
Install UNRAR on Linux Mint 21, 20
Update Linux Mint Before UNRAR Installation
Begin by updating your Linux Mint operating system. This step ensures that all packages on your system are current, which is crucial for a smooth installation of UnRAR.
Open your terminal window and execute the command:
sudo apt update && sudo apt upgrade
This command first updates the list of available packages and their versions (sudo apt update
) and then upgrades the installed packages to their latest versions (sudo apt upgrade
).
Install UNRAR on Linux Mint via APT Command
After updating your system, proceed to install UnRAR. This software is essential for handling RAR files, which are widely used for file compression and archiving.
To install UnRAR, use the command:
sudo apt install unrar
This command installs the RARLab’s version of UnRAR, a robust and widely-used version, making it a preferred choice for handling RAR files in Linux Mint.
Install UNRAR-free on Linux Mint via APT Command
Alternatively, if your preference leans towards open-source software, consider installing the unrar-free package. While it’s a non-proprietary version, it’s important to note that it lacks support for RAR 4 and 5 formats.
To install unrar-free, use:
sudo apt install unrar-free
Remember that the unrar-free version may have different command usage compared to the standard UnRAR commands. This distinction is particularly relevant if you frequently work with RAR 4 or 5 files, where the unrar-free version might not meet your needs.
Basic UNRAR Commands on Linux Mint 21, 20
Extract Files without Archived Paths
To extract files from a RAR archive without retaining their original directory structure, use:
unrar e archive.rar
This command is particularly useful when you need the files themselves, not their archived folder paths. Replace archive.rar
with the name of your specific RAR file. It’s an efficient way to quickly access the contents of an archive without dealing with its internal organization.
List Archive Contents
To see what’s inside an RAR archive without extracting it, the following command comes in handy:
unrar l archive.rar
Replace archive.rar
with the name of your RAR file. This command provides a list of all files contained within the archive, allowing you to assess its contents beforehand. It’s a practical step for verifying contents, especially in environments where you handle numerous archives.
Print File to Standard Output
If you need to view the contents of a specific file within a RAR archive directly in your terminal, use:
unrar p archive.rar file.txt
Here, archive.rar
should be replaced with the name of your RAR file, and file.txt
with the file you want to view. This command is especially useful when you need to quickly check the content of a file without going through the process of extracting the entire archive.
Test Archive Files
To check the integrity of a RAR archive, ensuring it’s free from errors or corruption, the following command is used:
unrar t archive.rar
Replace archive.rar
with your archive’s name. This command is a key step in verifying the health of an archive before you proceed with its extraction, ensuring that the files you’re working with are intact and error-free.
Verbosely List Archive Contents
For a more detailed view of the contents within a RAR archive, including file sizes and compression ratios, use:
unrar v archive.rar
Substitute archive.rar
with your RAR file’s name. This verbose output is ideal for gaining a comprehensive understanding of the archive’s contents, particularly useful in scenarios where file sizes and compression details are important for your workflow.
Extract Files with Full Path
To extract files from a RAR archive while preserving the full path, use:
unrar x archive.rar
This command maintains the original folder structure, which is crucial when the directory hierarchy within the archive is as important as the files themselves. Replace archive.rar
with the name of your RAR file.
Set Password for Decrypting Archive
To extract files from a password-protected RAR archive, use:
unrar x -ppassword archive.rar
Replace archive.rar
with your RAR file and password
with the archive’s password. This command is essential when dealing with secured archives, ensuring that only authorized users can access the contents.
Exclude Specified File from Extraction
If you want to extract all files from an archive except for specific ones, use:
unrar x -xfile_to_exclude.txt archive.rar
Here, archive.rar
is your RAR file, and file_to_exclude.txt
is the file you wish to omit. This command is particularly useful when dealing with large archives and you need to exclude certain files.
Update Files in the Archive
To update files in an existing RAR archive, use:
unrar u archive.rar
Replace archive.rar
with your RAR file. This command updates only the files that are older than those in the archive, making it a time-efficient way to keep your archives up-to-date.
Set Output Path for Extracted Files
To extract files to a specific directory, use:
unrar x -op/destination/path/ archive.rar
Replace /destination/path/
with your desired output directory and archive.rar
with the RAR file. This command is helpful when organizing extracted files in a specific location.
Extract and Overwrite Existing Files
To extract files and overwrite any existing files with the same name, use:
unrar x -o+ archive.rar
This command, applied to archive.rar
, ensures that the extraction process replaces any conflicting files in the destination directory.
Extract Without Overwriting Existing Files
Conversely, to avoid overwriting existing files during extraction, use:
unrar x -o- archive.rar
Apply this to archive.rar
to keep your existing files intact while extracting new ones.
Conclusion: Installing UnRAR on Linux Mint
That’s a wrap on our UNRAR guide for Linux Mint! We’ve walked through updating your system, installing UNRAR, and explored a variety of commands to manage your RAR archives efficiently. Remember, whether it’s extracting files, checking archive integrity, or handling password-protected archives, UNRAR has got you covered. Keep experimenting with these commands to find what works best for your tasks. And hey, don’t forget about the unrar-free option if open-source is your thing, though remember it has its limits.