[26.04 TIP #2] How to launch graphical applications in sudo mode

[Updated on May 12, 2026]

Things have changed with the switch to Wayland. Some, such as GParted, won’t launch, while others, such as Nemo, cannot be used in administrator mode.

Don’t worry, all is not lost, this little workaround will let you run such apps in sudo mode.


Open a terminal and paste this line to create a “.bash_aliases” file at the root of your home directory to avoid cluttering .bashrc:

gedit .bash_aliases

Copy and paste this line to create an alias:

alias sd='_sd() { xhost si:localuser:root; sudo "$1" "$2" 2> /dev/null; }; _sd' # Launch a graphical application in sudo mode

Save and close the terminal.


The next time you open the terminal, simply type “sd application_name” — followed by a path if necessary —, like this, to launch apps with superuser permissions:

sd gparted
sd gedit /etc/fstab
sd nemo /usr/share/applications
2 Likes