How to Fix “Unable to Capture Screen” on Ubuntu 22.04 LTS
If you are encountering the error “Unable to capture screen” while using Flameshot on Ubuntu 22.04 LTS, this guide will help you resolve the issue. Follow these steps to install and configure Flameshot correctly, ensuring it functions without any problems.
Step 1: Remove Existing Flameshot Versions
First, remove any existing versions of Flameshot that you have installed. It’s important not to install Flameshot from Snap Store as this may cause compatibility issues.
To remove any existing versions of Flameshot and avoid installing it from the Snap Store on Ubuntu, follow these steps through the terminal:
- Open the terminal (
Ctrl + Alt + T
). - Run the following command to remove Flameshot if it was installed via
apt
or another package manager:sudo apt remove --purge flameshot
- If Flameshot was installed using Snap, remove it with:
sudo snap remove flameshot
- Clean up residual configuration files:
sudo apt autoremove --purge
Step 2: Install Flameshot
Install Flameshot using the following command in your terminal:
sudo apt-get install flameshot
Step 3: Edit GDM Configuration
To fix the “Unable to capture screen” error, you need to edit the GDM configuration file. Follow these steps:
- Open the GDM configuration file located at
/etc/gdm3/custom.conf
in a text editor with root privileges. For example, use thenano
editor:sudo nano /etc/gdm3/custom.conf
- Locate the following line:
#WaylandEnable=false
- Uncomment the line by removing the
#
at the beginning, so it looks like this:WaylandEnable=false
Your updated custom.conf
file should now look like the following:
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false
# Enabling automatic login
# AutomaticLoginEnable = true
# AutomaticLogin = user1
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 10
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
- Save the file and exit the editor. For example, if you are using
nano
, pressCtrl+O
to save andCtrl+X
to exit.
Step 4: Restart Your Machine
To apply the changes, restart your computer:
sudo reboot
Once your machine restarts, Flameshot should work as expected without displaying the “Unable to capture screen” error.
Acknowledgment
This solution was inspired by the discussion and fix provided by Bhagavan Bollina.
By following the steps outlined in this guide, you can enjoy a seamless screen capturing experience with Flameshot on Ubuntu 22.04.3 LTS.