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

**URL:** <https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556>\
**Category:** General\
**Created:** [April 25, 2026, 3:25pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556 "2026-04-25T15:25:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [April 25, 2026, 3:25pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/1 "2026-04-25T15:25:26Z")

</div>

[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:

```auto
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:

```auto
sd gparted
sd gedit /etc/fstab
sd nemo /usr/share/applications

```

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 28, 2026, 9:32am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/2 "2026-05-28T09:32:31Z")

</div>

Hi @jlb

I have a problem with that :

```auto
marc@Marc-ROG-JOY-Budgie26:/$ gedit .bash_aliases

**(gedit:19436): WARNING**: 11:27:04.965: Could not load Peas repository: Typelib file for namespace 'Peas', version '1.0' not found

**(gedit:19436): WARNING**: 11:27:04.966: Could not load PeasGtk repository: Typelib file for namespace 'PeasGtk', version '1.0' not found
marc@Marc-ROG-JOY-Budgie26:/$ sudo gedit .bash_aliases
Authorization required, but no authorization protocol specified

(gedit:20284): Gtk-WARNING **: 11:28:49.041: cannot open display: :1

```

🤔

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 28, 2026, 10:02am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/3 "2026-05-28T10:02:22Z")

</div>

Don’t worry, @Marc_Driver, 26.04 won’t stop complaining. 🙄

Don’t pay any attention to the whiners and add this alias to .bash\_aliases:

`alias gu='gedit 2> /dev/null' # Remove Gedit's complaints in "user" mode`

```auto
gu .bash_aliases
gu .bashrc

```

… or, just for a little Shadok-style fun: 🤭

`alias gedit='_gedit() { gedit 2> /dev/null "$1" ;}; _gedit' # Gedit in "user" mode`

```auto
gedit .bash_aliases
gedit .bashrc

```

In any case, add `2> /dev/null` to your aliases or command lines whenever your terminal complains.

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 28, 2026, 6:57pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/4 "2026-05-28T18:57:57Z")

</div>

I don’t worry, I’m happy…I have replies…

Even without the modification suggested, there is no more complaint from 26.04; with, it is the same result i.e. nothing

```auto
marc@Marc-ROG-JOY-Budgie26:~$ sd nemo
localuser:root being added to access control list
[sudo: authenticate] Password:             
marc@Marc-ROG-JOY-Budgie26:~$ 

```

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 28, 2026, 7:16pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/5 "2026-05-28T19:16:51Z")

</div>

Trust me, you should create two different aliases: gedit complains even when superuser privileges aren’t required.

After all, that was your question, wasn’t it?

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 29, 2026, 5:19am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/6 "2026-05-29T05:19:16Z")

</div>

> [@jlb](#):
>
> Trust me, you should create two different aliases: gedit complains even when superuser privileges aren’t required.

Sure, I trust you and I have done it.

> [@jlb](#):
>
> After all, that was your question, wasn’t it?

My question is : how to make this bloody 26.04 without complaint ?

for the complaint, there is no more. For the work, nemo does not open at all neither in administration mode if it is alone or in normal mode with the sd command, ok with a directory; for fstab, it works; for GParted it seems doing nothing (is it installed ? ).

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 29, 2026, 5:55am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/7 "2026-05-29T05:55:04Z")

</div>

My “sd” alias is only used to launch graphical applications like Nemo or GParted in superuser mode.

Nemo opens just fine in user mode, either from its launcher or the terminal.

As for GParted, it’s one of Ubuntu’s quirks: if it’s available in a live session, the installation uninstalls it — yes, I checked by following the process in terminal mode. _Va comprendre_ ! 🙄

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 29, 2026, 6:09am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/8 "2026-05-29T06:09:46Z")

</div>

> [@jlb](#):
>
> My “sd” alias is only used to launch graphical applications like Nemo

But I cannot launch it if it is not followed by a directory.

For example :

```auto
sd nemo

```

does not work.

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 29, 2026, 2:32pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/9 "2026-05-29T14:32:54Z")

</div>

You really are cursed, @Marc_Driver! 🤭

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

This alias works like a small script; it collects two pieces of information entered by the user: the application to launch ($1) and an optional path ($2).  
But while $1 is compulsory, $2 is not: see `sd gparted`.

For Nemo, it’s exactly the same, and sorry, it works:

 ![sd nemo](https://canada1.discourse-cdn.com/flex035/uploads/ubuntubudgie/original/2X/a/a46d226e6232ec42cb7831964c1d13eae81b7693.png)

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 29, 2026, 5:39pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/10 "2026-05-29T17:39:19Z")

</div>

> [@jlb](#):
>
> You really are cursed

Damned !

I tried again and again and always the same result.

But before sending this I checked my .bash\_aliases and saved it again.

And now my “sd nemo” works 🤫 🤔 😊

I hope it will continue in this way 😎

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 30, 2026, 4:31am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/11 "2026-05-30T04:31:59Z")

</div>

> [@Marc\_Driver](#):
>
> I checked my .bash\_aliases

I’m glad it’s working for you too, but could you explain what you mean by that and what you changed?

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 30, 2026, 11:05am UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/12 "2026-05-30T11:05:10Z")

</div>

@jlb

> [@jlb](#):
>
> could you explain what you mean by that and what you changed?

My line

```auto
alias gu='gedit 2> /dev/null' # Remove Gedit's complaints in "user" mode

```

was preceeded by # as a comment.

I really don’t know it changed something as I have not used

gu .bash\_aliases  
gu .bashrc

If you understand, please explain. 😊

---

<div class="post-metadata">

**Author:** ![jlb](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/jlb/32/4919_2.png) [@jlb](https://discourse.ubuntubudgie.org/u/jlb)\
**Post date:** [May 30, 2026, 1:40pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/13 "2026-05-30T13:40:33Z")

</div>

Thank you for helping me understand.

A hash symbol at the beginning of a line in this type of file disables it by turning it into a comment.  
However, only you know why there was a hash symbol at the beginning of that line… 😅

---

<div class="post-metadata">

**Author:** ![Marc\_Driver](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/marc_driver/32/5785_2.png) [@Marc\_Driver](https://discourse.ubuntubudgie.org/u/Marc_Driver)\
**Post date:** [May 30, 2026, 8:15pm UTC](https://discourse.ubuntubudgie.org/t/26-04-tip-2-how-to-launch-graphical-applications-in-sudo-mode/8556/14 "2026-05-30T20:15:02Z")

</div>

Yes I have done various tests while my device seemed capricious; this hash escaped to me… 🫨
