- Cabextract allows you to list, test, extract, and repair Microsoft CAB files on systems such as UNIX.
- It is essential for WineLutris and winetricks handle installers of Windows that depend on .cab files.
- Cabextract allows you to obtain fonts and resources for Office and PowerPoint installers for use in Linux.
- lcab complements cabextract by allowing you to create CAB files from Linux to distribute data to Windows.

If you work with Windows installation files from LinuxSooner or later you'll come across the famous files .CAB (Microsoft Cabinet). Although not as common in the GNU/Linux ecosystem as .tar.gz or .zip files, they are still ubiquitous in Microsoft program installers, drivers, and patches. Fortunately, we have text-based tools that allow us to manipulate them quite easily.
In this article we are going to delve into cabextract and lcabTwo utilities designed to handle CAB files on UNIX-like systems. You'll see exactly what these containers are, how to install the tools on different distributions, what options they offer for listing, extracting, testing, or even repairing damaged cabinets, and in what real-world situations (Wine, Windows fonts, PowerPoint viewers, etc.) they can get you out of a tight spot.
What is Microsoft's CAB format?
The format CAB (Microsoft Cabinet) It was designed by Microsoft as its native packaging and compression method of files in Windows. It is used extensively in the platform's installation engines: Setup API, Device Installer, AdvPack, Windows Installer, and other system components responsible for deploying software and updates.
A file with an extension . Cab works as a compressed containerIt groups multiple files and directories, supports different compression algorithms (such as MSZIP, LZX, or Quantum), and can incorporate digital signatures to ensure the integrity of the content. This explains why you see it accompanying typical installers like setup.exe or install.exe, where the executable acts as a "launcher" and the actual data travels within one or more CAB files.
Although in Windows they are managed almost transparently thanks to the installation wizards, in GNU / Linux These containers aren't that common, so you need specific utilities to open them, inspect them, or extract their contents without running the original installer.
In addition to classic desktop packages, CABs are found in Windows CE installation filesSystem updates, web fonts, video codecs, Office templates, and all kinds of redistributable resources that Microsoft and other vendors package in this format.
Cabextract: the key tool for extracting CAB files
cabextract It's an online program commands designed to Extract files from Microsoft CAB containers on UNIX and derivative systems (GNU/Linux, BSD, macOS, etc.). It is distributed as Free software under the GNU GPL license and relies on the portable library libmspack (LGPL license), specializing in Microsoft compression formats.
The utility is capable of handling all the usual variants and features of .CAB files, including the cabinets used by Windows CE and "nested" cabinets (when one CAB contains other CABs inside). It also knows how to deal with multi-part cabinetsThese installers distribute the data across several consecutive files and are automatically reassembled in Windows.
Among its strengths, cabextract can preserve the internal directory structure, maintain dates and permissions of the extracted files, perform integrity tests without writing the data to disk, and even attempt to rescue information from corrupt cabinets replacing the unreadable areas with zeros in order to continue with the rest of the blocks.
Although it has existed for years and has gone through different versions, it is consolidated in the ecosystem of many distributions and has pre-compiled packages for a wide variety of platforms: Debian, Ubuntu, Fedora, Gentoo, Slackware, T2 SDE, FreeBSD, NetBSD, OpenBSD, Solaris, macOS (Fink, MacPorts), Cygwin on Windows, AmigaOS, DOS/FreeDOS and more.
Cabextract installation on different platforms
In most modern GNU/Linux distributions you can install cabextract from the official repositoriesThis greatly simplifies the task, as you no longer need to compile manually or hunt down loose binaries on the web.
In systems based on Debian or UbuntuThe classic installation is done with:
sudo apt-get install cabextract
or, if you prefer aptitude:
sudo aptitude install cabextract
Once the installation is complete, Wine and other tools that depend on this utility will be able to automatically decompress the .cab files that they find in installers and assistants.
In other distributions, the command varies, but the idea is exactly the same: to use the package manager of the system. For example, in RPM-based environments you could use:
sudo rpm -i cabextract-1.6-1.i386.rpm
And if you're interested in compiling from source code (for example, to test the development version), the typical workflow would be:
tar zxf cabextract-1.6.tar.gz
cd cabextract-1.6
./configure
make
sudo make install
Within the project tree you will find a file INSTALL with more detailed instructions, as well as auxiliary scripts such as rebuild.sh in the libmspack development repository, designed to regenerate the configuration when you work directly with the GitHub branch.
Basic Cabextract usage options
Once installed, the starting point for understanding all options available It's best to consult its built-in help and manual page. For this, you have two very useful resources:
cabextract --help
and the classic documentation in man format:
man cabextract
The summary that shows the option -help It offers a quick overview of the most common flags, while the manual page goes into more detail and explains specific use casesNotes on safety, behavior with multi-part cabinets, filters, etc.
In typical use, simply execute the command followed by the name of the CAB file or the executable that contains it and cabextract takes care of doing the heavy lifting:
cabextract archivo.cab
O well:
cabextract InstaladorWindows.exe
In this scenario, the tool will extract all the files contained in the cabinet (or cabinets, if there are several) in the current directory, maintaining the internal folder structure and timestamps associated with each item.
List, test, and extract CAB files
In addition to its simple function of decompressing, cabextract incorporates several options that are useful to have readily available when working with many installers or when you simply want to inspect what's inside a .cab file without actually extracting it.
To prove integrity To decompress a CAB file, that is, to read it completely and decompress it internally but without writing the resulting files to disk, the option is used -t (o -test):
cabextract -t sls.cab
This operation performs the entire extraction process in memory and, in addition, calculates and prints a MD5 checksum for each file contained in the cabinet. This is especially useful when you want to verify if a downloaded installer is complete before using it, or if you suspect that the file has been corrupted when copying it between computers.
If instead of testing integrity you prefer list content From the CAB, you can resort to the option -l o –list:
cabextract -l sls.cab
With this command, the utility will display on the screen the names of all the files inside the cabinet, accompanied by information such as size, relative path or logical folder to which they belong, depending on how the CAB was created.
For complete extraction to a specific directoryYou have the option -d (o –Directory). For example, if you want to dump the contents of a cabinet to /tmp/cab_files/ you can run:
cabextract sls.cab -d /tmp/cab_files/
This way, instead of filling the current directory with files, you'll have all the material neatly enclosed in a separate path, which is very useful when you're analyzing large installers or performing reverse engineering tasks.
If, after the first extraction, you discover that one of the generated files is in turn another CABThe procedure for continuing to open it is identical. For example:
cabextract /tmp/cab_files/environment.cab -d /tmp/cab_files2/
With this series of steps you delve deeper into the different levels of packaging that many Microsoft installers chain together, until you finally access the XML files, binaries, sources or other resources that really interest you.
Advanced options and fine control over extraction
cabextract doesn't just decompress everything; it also allows you to to refine what is extracted and howThis is especially valuable when working with large cabinets or when you are only interested in certain types of files.
On one hand, the program searches automatically embedded cabinets within other files and extracts them without you having to explicitly specify it. Likewise, if it detects multi-part cabinetsIt attempts to locate and link all the pieces to treat them as a single unit. If, for any reason, you wish to disable this behavior, you have the option –single, which forces cabextract to work only with the file you have passed it.
When you are only interested in certain files (for example, all the audio files with the .wav extension within a huge package), you can use the option –Filter to limit extraction. A classic example would be:
cabextract --filter '*.wav' music.cab
In this case, cabextract iterates through the content of music.cab But it only extracts the files whose names match the specified pattern, ignoring the rest. This saves you space, processing time, and clutter in your working directory.
Another interesting possibility is to force that All extracted filenames will be converted to lowercase. by option –lowercaseThis can be useful in environments where case sensitivity in paths causes problems, or if you simply want to normalize names for organizational purposes.
Regarding location, we've already seen that you can use –Directory (or its shortcut -d) to send the extracted files to a specific folder. Combining this option with filters and name conversion gives you fairly fine control over the final result of each extraction.
Repair of damaged CAB files and security
In the real world, it is relatively common to encounter corrupt CAB files: downloads incomplete, errors in devices storagenetwork outages, etc. cabextract incorporates an option called –fix designed to try save as much data as possible when you encounter a damaged cabinet.
When using –fixThe unreadable portions of data are replaced with zeros, and the tool attempts to move on to the next blocks, hoping they are intact. This process doesn't "repair" the file in the strict sense (the corrupted information is lost), but it often allows the recovery of some content that would otherwise be inaccessible.
Historically, cabextract and the libmspack library have been correcting various security vulnerabilities related to the handling of malicious or specially manipulated files. Among the most prominent are problems with:
- Directory tours using sequences like "../" to attempt to write outside the current directory (CVE-2004-0916).
- absolute paths and combinations of "/" and "\" in Cygwin that could bypass security checks and force extraction to arbitrary locations (CVE-2015-2060).
- Out-of-range readings in certain LZX or MSZIP decompression scenarios (CVE-2015-4470, CVE-2015-4471).
- Infinite loops and incorrect memory accesses in the Quantum decoder and other algorithms when processing invalid offsets or lengths, especially in 32-bit architectures (CVE-2014-9732, CVE-2014-9556, CVE-2010-2800, CVE-2010-2801).
The latest versions have fixed these flaws, so it's always recommended to update. Keep Cabextract updated from your distribution's repositories. This ensures you minimize the impact of CAB files specifically designed to cause errors or exploit weaknesses in the decoder.
Cabextract and Wine: Windows installers on Linux
If you use Wine or Lutris To run Windows applications on Linux, you've probably already encountered error messages during installation that mention files . CabThis happens because many installers expect to be able to access these cabinets natively, and if the environment does not have a suitable tool to decompress them, the process may fail halfway through.
A very typical case is encountering an installer that includes a file with the ".cab" extension and that, when attempting to deploy it under Wine, It throws an error during the installation phase.Without cabextract, Wine doesn't know how to properly handle these containers, so the wizard either stops or fails to copy all the necessary components.
In many scenarios, the solution simply involves install cabextract on the host systemso that Wine, winetricks, or Lutris can invoke it in the background when they need to decompress one of these cabinets. In Ubuntu, for example, you can do this from a terminal with:
sudo apt-get install cabextract
Once installed, it's quite common for installers that previously failed to start working correctly without you having to change anything else, since the only thing they were missing was the ability to extract encapsulated .cab files.
Practical use: Windows fonts and PowerPoint viewer
Beyond academic examples, cabextract has very specific and practical uses in the day-to-day life of a Linux desktop user who works with Office documents or wants to take advantage of some Windows resources without installing the full operating system.
A classic scenario is that of those who want Installing certain Windows fonts on GNU/Linux (for example, those of Vista or Office 2007) so that your documents look exactly the same as on computers with Microsoft Officeor to avoid layout problems when opening presentations and spreadsheets.
For most common fonts, simply install the package. msttcorefonts (or its equivalent depending on the distribution), which includes a fairly complete set: Arial, Times New Roman, Verdana, Tahoma, etc. But if you want fonts like Calibri or Cambria, used extensively in modern documents, you need to go a step further.
One popular option is to download the PowerPoint 2007 viewer for Windows or the Microsoft Office Compatibility Pack for earlier versions of Office. These packages contain the fonts you're interested in, packaged in CAB files which you can access with cabextract.
The general flow It would be something similar to this (adapted to a Debian/Ubuntu environment):
- Install cabextract if you don't already have it:
sudo apt-get install cabextract - Download the PowerPoint Viewer 2007 executable or the Office 2007 compatibility pack to the directory of your choice.
- From the terminal, navigate to that folder and Unzip the executable with cabextract, for example:
cabextract PowerPointViewer.exe - An intermediate CAB file will appear among the generated files (for example, ppviewer.cab or similar). You open it again:
cabextract ppviewer.cab - Create a directory to neatly store the extracted fonts. For example, for Vista fonts:
sudo mkdir -p /usr/share/fonts/truetype/vista - Move all font files (extensions) .TTF, .ttf, .ttc, etc.) to that folder:
sudo mv *.TTF /usr/share/fonts/truetype/vista - Update the system font cache so that the new fonts are registered:
sudo fc-cache -f -v
With these steps, your Linux desktop environment will have the same sources available that use Windows Vista and Office 2007, which helps documents display without strange jumps or font substitutions.
There are even specific cases like that of the source gaugeswhere they have been detected different versions (For example, version 1.02, included in certain editions of Office 2007, may display incorrectly on Linux at sizes between 10 and 14 pixels.) An alternative is to obtain an earlier version (1.0) through the Office Compatibility Pack, extract it with cabextract as described, and register only that version on the system to improve rendering.
Common problems with cabextract in Lutris and winetricks
By integrating cabextract with tools such as Lutris or winetricksSometimes, somewhat cryptic error messages appear, which actually boil down to fairly specific problems: CAB files that don't exist, downloads with incorrect MD5 checksums, or cabinets that are not considered valid by the tool.
Imagine a scenario where you try to install a Windows game like ooo! through Lutris. The script The installation may require the PowerPoint viewer (ppviewer) to have certain fonts or components available, and use winetricks in the background to download and extract the corresponding executable.
In such a situation, you might see an error like this:
cabextract -q -d /ruta/temp -F ppviewer.cab /home/usuario/.cache/winetricks/PowerPointViewer/PowerPointViewer.exe
/home/usuario/.cache/winetricks/PowerPointViewer/PowerPointViewer.exe: no se encontraron cabinets válidos
and right after:
advertencia: el comando cabextract ... devolvió el estado 1. Abortando.
This type of message usually indicates that cabextract did not find any valid CAB file within the downloaded executable, usually because the download is corrupted or because the exact installer version that winetricks expects no longer matches the one obtained from Microsoft servers.
An additional symptom is that Winetricks itself marks the package as failed in the md5sum verificationThis reinforces the idea that the download does not match the checksum expected by the script. In that case, the problem is not with cabextract itself, but with the inconsistency between the winetricks script and the file actually downloaded.
Given these scenarios, the logical steps involve force the reinstallation from the component from winetricks (so that it downloads it again), manually check if the file exists and can be opened with cabextract from the terminal, or look for an alternative version of the installer that matches the MD5 checksum expected by the script.
lcab: creating CAB files from Linux
So far we have focused on cabextract, which is used to unpack cabinetsIf what you need is the reverse process, that is, Generate your own CAB files To distribute software or data from Linux to Windows systems, the tool that comes into play is lcab.
lcab is a small command-line program designed specifically for build CAB cabinets from one or more input files. Although not as well-known as cabextract, it is useful when you want to package content while respecting Microsoft's native format, for example to integrate it into installers or to take advantage of components that expect a specific CAB file.
Its general syntax is usually simple: you indicate the name of the output cabinet and then the files you want to package. From there, lcab takes care of generating the internal structure required by the format and applying the appropriate compression. Combined with cabextract, you have a Full round-trip flow: remove existing cabinets, modify them and repackage them if necessary.
In practice, lcab doesn't usually include as many advanced options as cabextract, but for tasks such as distribution, testing, or emulation of Windows environments Linux is usually more than enough.
Overall, having cabextract and lcab in your toolbox allows you to both consume , the generate Microsoft Cabinet from a UNIX system, which opens the door to automating installations, analyzing update packages, extracting proprietary resources (always respecting their licenses) or solving compatibility problems with Wine and derivatives.
Mastering the everyday use of cabextract, knowing its options for listing, testing, and repairing cabinets, and knowing when it's best to use lcab to create your own .cab files, puts you in a much more comfortable position when you have to navigate the world of Windows and GNU/LinuxIt's about understanding what those often overlooked .CAB files are hiding, and taking advantage of these free tools so they work in your favor instead of becoming an obstacle.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.

