I have created a custom distro using Cubic which comes from Ubuntu 20.04.2 LTS Desktop 64-bit.
I have noticed that if I open the file manager as root and then double click on the file then it works.
I have also noticed that in the ubiquity.desktop file, if I change the default line:
Exec=sudo --preserve-env=DBUS_SESSION_BUS_ADDRESS,XDG_RUNTIME_DIR sh -c 'ubiquity gtk_ui'
In:
Exec=sudo --preserve-env=DBUS_SESSION_BUS_ADDRESS,XDG_RUNTIME_DIR ubiquity gtk_ui
The problem is solved.
There seems to be a problem with the sh -c ''
command when is executed in a file manager with normal privileges through a .desktop file, even if the sudo command is used inside it.
Instead it runs correctly from the terminal both as a normal user and as root.
Why?
which sh
points to/usr/bin/sh
. Do you have this problem when creating a*.desktop
file in an original Ubuntu live environment? – Enterprise Jul 05 '21 at 01:30sh -c ''
. Nevertheless, per AskUbubtu guidelines, you should post your solution as an Answer, below. Aldo, edit your question and remove the solution from the Question section. After a ~couple~ of days, you can select your own answer as Accepted. This will help other users who are experiencing a similar problem quickly find an answer to their issue. Welcome to AskUbuntu, by the way! – Enterprise Jul 09 '21 at 19:08sh -c ''
. I performed a test in an unmodified Ubuntu Live ISO, andsh -c ''
does work. Try the same test yourself... It is possible that something you've customized has affected this. Think carefully about the changes you have made. Also, you might want to make a only few changes, generate an ISO, and test. Then repeat this process, making more changes each time, until you find what modification is causingsh -c ''
to not work in a*.desktop
file. – Enterprise Jul 14 '21 at 21:30