Ubuntu 18.04 XAMPP desktop icon "There was an error launching the application"
This worked for me on Ubuntu 18.04.
First you need to install the package "nautilus-admin":
sudo apt-get update
sudo apt-get install nautilus-admin
Create a new file in "/usr/share/polkit-1/actions/xampp.policy" with:
sudo nano /usr/share/polkit-1/actions/xampp.policy
Add this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.freedesktop.policykit.pkexec.run-xampp">
<description>Run the Xampp Control Panel</description>
<message>Authentication is required to run the Xampp Control Panel</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/opt/lampp/manager-linux-x64.run</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
</action>
</policyconfig>
To end, create a new file or edit the desktop entry on /usr/share/applications/xampp-control-panel.desktop
and replace Exec=gksudo /opt/lampp/manager-linux-x64.run
with Exec=pkexec /opt/lampp/manager-linux-x64.run
:
sudo nano /usr/share/applications/xampp-control-panel.desktop
[Desktop Entry]
Encoding=UTF-8
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
Exec=pkexec /opt/lampp/manager-linux-x64.run
Icon=/opt/lampp/htdocs/favicon.ico
Categories=Application
Type=Application
Terminal=false
I hope it helps.
Related videos on Youtube
eric
Updated on September 18, 2022Comments
-
eric over 1 year
I created an icon on the desktop and entered the following code:
[Desktop Entry] Encoding=UTF-8 Name=XAMPP Control Panel Comment=Start and Stop XAMPP Exec=gksudo /opt/lampp/manager-linux-x64.run Icon=/opt/lampp/htdocs/favicon.ico Categories=Application Type=Application Terminal=false
When I launch the application I get "There was an error launching the application"
If I go into the terminal and type
sudo /opt/lampp/manager-linux-x64.run
, it works fine. I tried changinggksudo
tosudo
but that didn't work either.What am I doing wrong?
-
Jude Fernandes almost 5 yearsTried on ubuntu 19, the only one that works perfectly without
gksu
orgksudo
. Thank you!!. -
PhatHV over 3 yearsI confirmed it also works in Ubuntu 20.04.