Install.sh does not work with sudo

Hi there,
I downloaded latest Arduino IDE (not the beta), and failed to have the shortcut Desktop properly installed.
The reason is that the install.sh script relies on $HOME, which is set to /root when calling the script with:
$ sudo install

To make it work, these lines should be added at the beginning:

if [ x${SUDO_USER} != x ]; then
  HOME=$(awk -v u="$SUDO_USER" -v FS=':' '$1==u {print $6}' /etc/passwd)
fi

Regards,

Xavier

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.