Images fail to display in Ubuntu 24.04 LTS because the default GNOME desktop environment lacks a native image viewer application installed by default. To resolve this, you must install a dedicated image viewing package via the terminal using the
apt package manager. This guide details the installation process and configuration steps required to restore full image preview capabilities across your file system.
Identifying the Root Cause
Ubuntu 24.04 LTS, like many modern Linux distributions, prioritizes a lightweight base installation. While the operating system includes robust tools for development, web browsing, and office productivity, it often omits specialized media viewers to save disk space. When you double-click an image file in the Files application (Nautilus), the system attempts to launch the default handler. If no handler is registered or installed, the action fails silently or presents an error dialog indicating that the appropriate software is missing.
This issue is distinct from graphical driver problems. Your GPU drivers are likely functioning correctly if other graphical applications run smoothly. The problem is strictly related to the absence of user-space software capable of decoding common image formats such as JPEG, PNG, and WebP. Without a viewer, the operating system cannot render the pixel data into a visual window for the user.
Installing a Default Image Viewer
The most reliable solution is to install a standard image viewer that integrates well with the GNOME desktop environment.
Eog, also known as Eye of GNOME, is the traditional default viewer for GNOME-based systems. It is lightweight, supports a wide range of formats, and handles batch operations efficiently. Alternatively,
GThumb offers more advanced features for managing large libraries of photos. For most users, installing
eog is sufficient to fix the immediate display issue.
To begin, open your terminal. You can do this by pressing
Ctrl+
Alt+
T or by searching for "Terminal" in the application menu. Once the terminal window is active, you need to update your local package index to ensure you are downloading the latest version of the viewer. Run the following command:
sudo apt update
After the update completes, install the Eye of GNOME package by executing:
sudo apt install eog
You will be prompted to enter your sudo password. Type it carefully; characters will not appear on screen for security reasons. Press Enter when finished. The system will then download and install the necessary dependencies. Once the installation finishes, close the terminal.
If you prefer a more feature-rich alternative, you can install GThumb instead using:
sudo apt install gthumb
Both applications are now available in your application menu. However, simply installing them does not automatically set them as the default handler for all image types. You must explicitly configure the system associations.
Setting the Default Application
To ensure that double-clicking an image always opens it in your newly installed viewer, you need to change the file association. Navigate to any image file in your home directory. Right-click on the image and select
Properties. In the properties window, locate the
Open With tab. You will see a list of available applications. Select
Eye of GNOME (or GThumb) from the list. Click the
Set as default button. This action registers the viewer as the primary handler for MIME types such as
image/jpeg and
image/png.
For a more comprehensive fix that applies to all supported image formats at once, you can use the
xdg-mime command line tool. Open the terminal again and run the following command to set EOG as the default viewer for all image types:
xdg-mime default eog.desktop image/*
This single command updates the user's MIME database, ensuring consistency across different file managers and contexts. Verify the change by right-clicking another image type, such as a WebP file, and confirming that EOG is selected.
Troubleshooting Persistent Issues
In rare cases, the installation may succeed, but images still fail to open. This is often due to corrupted MIME cache files or permission issues. First, ensure that the image files themselves are not corrupted. Try opening a known good image file to isolate the problem. If specific formats fail while others work, you may need to install additional codec packages. For example, support for HEIC files (common on iPhones) requires the
libheif-examples package. Install it with:
sudo apt install libheif-examples
Another potential cause is a conflict with previous configurations. Clearing the MIME cache can force the system to re-evaluate file associations. Run the following command to rebuild the cache:
update-mime-database ~/.local/share/mime
Restart your computer after making these changes to ensure all services reload the new settings. If the issue persists, consider checking the system logs for errors related to the image viewer using the
journalctl command.
Alternative Solutions for Minimalists
If you prefer a headless approach or are working on a server without a graphical interface, you can view images directly in the terminal. Tools like
fbi (framebuffer imageviewer) or
chafa allow you to render ASCII art representations of images. Install chafa with:
sudo apt install chafa
Then, view an image by running:
chafa image.jpg
While this method does not provide a full GUI experience, it is invaluable for remote administration tasks where bandwidth is limited. For most desktop users, however, installing a proper GUI viewer remains the best path forward.
Frequently Asked Questions
Why did my images stop displaying after updating Ubuntu?
Updates sometimes reset default application associations or remove deprecated packages. Re-running the
xdg-mime command to set your preferred viewer as the default usually restores functionality immediately without needing to reinstall the software.
Can I view images without installing any new software?
Not in the graphical desktop environment. The base Ubuntu installation intentionally excludes image viewers to maintain a minimal footprint. You must install a package like EOG or GThumb to enable visual rendering of image files through the file manager.
How do I open images in a specific format like HEIC?
Standard viewers may lack codecs for proprietary formats. You need to install additional libraries, such as
libheif-examples for HEIC files. Once installed, restart your image viewer application to detect and load the new codec support.
Is there a way to batch convert images if I cannot view them?
Yes, you can use command-line tools like
ImageMagick. Install it with
sudo apt install imagemagick and use commands like
convert input.jpg output.png to transform files even if you lack a graphical viewer for intermediate inspection.
What should I do if the default viewer crashes on startup?
Check the system logs for segmentation faults or library errors using
journalctl -xe. Often, reinstalling the viewer package resolves corrupted binaries. You can also try switching to an alternative viewer like GThumb to determine if the issue is specific to one application.