I have this executable: /opt/lampp/manager-linux-x64.run which needs to run as root.
If I execute this with sudo /opt/lampp/manager-linux-x64.run then it works fine.
I would like to add an entry to the application menu so that I can access this program without a terminal. In previous versions of Ubuntu I would use gksudo but this no longer exists in the latest version of Ubuntu. I was told the replacement for gksudo is admin://, so I tried both of these and neither work:
$ admin:///opt/lampp/manager-linux-x64.run
bash: admin:///opt/lampp/manager-linux-x64.run: No such file or directory
$ admin://opt/lampp/manager-linux-x64.run
bash: admin://opt/lampp/manager-linux-x64.run: No such file or directory
How do I use admin:// to execute a program as root?
I also tried pkexec and it did not work correctly. This command works when executed in a terminal, but doesn't work when I add the exact code to a .desktop file using the menu editor:
pkexec --user root env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /opt/lampp/manager-linux-x64.run