Running modern versions of MATLAB (R2024a, R2026a, etc.) on Arch Linux or its derivatives (like CachyOS) can be an incredibly frustrating experience. Because Arch relies on bleeding-edge system libraries and MATLAB ships with deeply embedded legacy libraries, they tend to crash into each other silently.
💡 Automated Fix Script Available! Don't want to run all these commands manually? Just download and run the
fix_matlab_arch.shscript included in this repository.To run the automated script:
# 1. Clone this repository git clone https://github.com/goatnath/MATLAB-Installation-guide.git cd MATLAB-Installation-guide # 2. Make the script executable chmod +x fix_matlab_arch.sh # 3. Run it! (It will prompt for your sudo password to move the graphics libraries) ./fix_matlab_arch.sh
This guide walks you through fixing the three most notorious MATLAB bosses on Arch Linux:
- The MathWorksServiceHost Crash (
lc_initsymbol collision) - The Silent Wayland GUI Crash (Bundled library conflicts)
- The Invisible Activation Window (Wayland fallback)
The Symptoms:
- You launch MATLAB, it reaches the splash screen, and silently dies.
- If you check the logs in
~/.MathWorks/ServiceHost/goattop/logs/, you see a fatal error complaining aboutlc_initorMathWorksServiceHostsuddenly stopping. - You get a "MathWorks communication error" when trying to run a script.
The Cause:
Modern Arch/CachyOS relies on a system package called nettle (or libleancrypto) for network cryptography (used by gnutls). Both the system's libleancrypto and MATLAB's internal licensing library (libmwlmgrimpl.so) globally export a C function literally just named lc_init. When MathWorksServiceHost tries to start, it loads the system's networking libraries alongside MATLAB's licensing libraries. The names collide, causing an immediate segfault.
The Fix:
You must provide MathWorksServiceHost with versions of gnutls, nettle, and hogweed that do not depend on libleancrypto. The easiest way is to drop the standard Arch packages directly into the ServiceHost folder so it uses them natively.
- Download the standard Arch packages to a temporary folder:
wget https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.8-1-x86_64.pkg.tar.zst -O /tmp/gnutls.pkg.tar.zst
wget https://archive.archlinux.org/packages/n/nettle/nettle-3.10-1-x86_64.pkg.tar.zst -O /tmp/nettle.pkg.tar.zst- Extract the libraries:
mkdir -p /tmp/gnutls-pkg /tmp/nettle-pkg
tar -xf /tmp/gnutls.pkg.tar.zst -C /tmp/gnutls-pkg
tar -xf /tmp/nettle.pkg.tar.zst -C /tmp/nettle-pkg- Copy the isolated libraries directly into the ServiceHost directory (Replace
v2026.7.0.6with your specific version found in that directory):
# Find your version folder first:
ls ~/.MathWorks/ServiceHost/-mw_shared_installs/
# Copy the libraries in:
cp -P /tmp/gnutls-pkg/usr/lib/libgnutls* ~/.MathWorks/ServiceHost/-mw_shared_installs/<YOUR_VERSION>/bin/glnxa64/
cp -P /tmp/nettle-pkg/usr/lib/libnettle* ~/.MathWorks/ServiceHost/-mw_shared_installs/<YOUR_VERSION>/bin/glnxa64/
cp -P /tmp/nettle-pkg/usr/lib/libhogweed* ~/.MathWorks/ServiceHost/-mw_shared_installs/<YOUR_VERSION>/bin/glnxa64/Note: Make sure all hanging MathWorksServiceHost processes are killed after doing this using pkill -9 -f MathWorksServiceHost.
The Symptoms: MATLAB initializes but crashes before the main window is rendered, usually providing absolutely no terminal output.
The Cause:
MATLAB bundles horribly outdated versions of freetype, glib, and harfbuzz. When its Chromium-based UI tries to render through Wayland on modern Arch Linux, these ancient libraries clash with your system's modern font rendering stack.
The Fix:
Force MATLAB to use your system's rendering libraries by hiding the bundled ones inside an exclude folder.
# Assuming MATLAB is installed at /opt/MATLAB/R2026a (change as needed)
cd /opt/MATLAB/R2026a/bin/glnxa64/
sudo mkdir -p exclude
# Move the culprits out of the way so MATLAB falls back to your system libraries
sudo mv libfreetype.so* exclude/ 2>/dev/null
sudo mv libglib-2.0.so* exclude/ 2>/dev/null
sudo mv libgio-2.0.so* exclude/ 2>/dev/null
sudo mv libharfbuzz.so* exclude/ 2>/dev/null
sudo mv libfontconfig.so* exclude/ 2>/dev/nullThe Symptoms: You run MATLAB for the very first time. It prints nothing, nothing opens, and it eventually closes.
The Cause:
If your license needs activation, MATLAB spawns a background executable (MathWorksProductAuthorizer). Because Wayland support for Java/Qt apps is notoriously flaky, this window can spawn completely invisibly. Because you can't click "Activate", the main MATLAB app gives up and exits.
The Fix: You must forcefully launch the Authorizer executable with XWayland compatibility enabled.
env QT_QPA_PLATFORM=xcb /opt/MATLAB/R2026a/bin/glnxa64/MathWorksProductAuthorizerComplete the activation in the window that pops up, and close it.
Because MATLAB still heavily relies on older Qt versions, it is highly recommended to always launch it using XWayland compatibility to prevent GUI freezes.
Launch it via the terminal:
env QT_QPA_PLATFORM=xcb /usr/bin/matlabNobody wants to type that every time. Create a persistent wrapper depending on your shell:
For fish users:
function matlab
env QT_QPA_PLATFORM=xcb /usr/bin/matlab $argv
end
funcsave matlabFor bash / zsh users:
Add this to your ~/.bashrc or ~/.zshrc:
alias matlab="env QT_QPA_PLATFORM=xcb /usr/bin/matlab"When quitting MATLAB, you may see a memory corruption error printed to the terminal. You can safely ignore this! It's simply MATLAB's bundled libraries failing to cleanly hand memory back to your modern glibc during the teardown sequence. It only happens after your files are saved and MATLAB has already exited.