In this short tutorial, you'll see how to fix Variety not starting on Linux Mint / Ubuntu — including the free(): invalid pointer crash that hits after downloading a wallpaper (commonly from Bing).
Problem
After a system upgrade or fresh install, Variety crashes immediately or silently fails to launch. Running it from the terminal reveals the culprit:
free(): invalid pointer
Aborted (core dumped)
This happens when Variety — confirmed on Ubuntu 24.04 LTS with variety 0.8.12 — attempts to write EXIF metadata to a downloaded image via GExiv2.Metadata. The crash triggers during save_locally(), right after fetching a wallpaper URL (e.g. from Bing). The root cause is a C library memory conflict between libgexiv2 and the system's libc, typically surfacing after package upgrades.
1. Confirm the Crash Source
Run Variety in verbose mode to isolate where it dies:
/usr/bin/variety -v 2>&1 | tail -30
If you see save_locally() followed by free(): invalid pointer, the GExiv2 metadata writer is the cause — not your wallpaper sources.
2. Reinstall GExiv2 and Dependencies
The most reliable fix for James or Sarah hitting this on a freshly upgraded Ubuntu system:
sudo apt remove --purge python3-gi gir1.2-gexiv2-0.10
sudo apt install python3-gi gir1.2-gexiv2-0.10
Then relaunch Variety:
variety &
3. Disable Metadata Writing (Quickest Workaround)
If reinstalling doesn't help, disable EXIF metadata in Variety's config:
nano ~/.config/variety/variety.conf
Find and set:
write_metadata = False
Save and restart Variety. This prevents GExiv2 from being called entirely.
4. Fix Variety Not Starting from Launcher
If Variety works in terminal but won't launch from the app menu (a separate but related issue), the .desktop launcher command may be stale. Fix it:
sudo nano /usr/share/applications/variety.desktop
Ensure the Exec line reads:
Exec=variety %U
Then enable autostart:
cp /usr/share/applications/variety.desktop ~/.config/autostart/
5. Tips for Diagnosing Startup Failures
- Always run
variety -vfirst — the log pinpoints exactly which module fails - Check
~/.config/variety/variety.logfor crash history - If the system tray icon is missing after a KDE/Plasma upgrade (common on Arch), try toggling
Use AppIndicatorin Variety Preferences → Indicator - After any
apt upgrade, restart Variety — library version mismatches are the #1 cause offree(): invalid pointercrashes