Ubuntu – Petalinux v2018.2 installation error

xilinx

I am installing Petalinux_v2018.2 on Ubuntu 2016.04.5

./petalinux-v2018.2.ir.run /opt/petalinux_2018.2/

But end with error:

./petalinux-v2018.2.ir.run: line 52: /opt/petalinux_2018.2/petalinux_installation_log: Permission denied
tee: /opt/petalinux_2018.2/petalinux_installation_log: Permission denied
INFO: Checking installer checksum...

tee: /opt/petalinux_2018.2/petalinux_installation_log: Permission denied
Please refer to the PetaLinux Tools Installation Guide.

Check the troubleshooting guide at the end of that manual, and if you are
unable to resolve the issue please contact customer support with file:
   /opt/petalinux_2018.2/petalinux_installation_log

tee: /opt/petalinux_2018.2/petalinux_installation_log: Permission denied
INFO: Extracting PetaLinux installer...
tar: /tmp/tmp.eeJueiu2Ol: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tee: /opt/petalinux_2018.2/petalinux_installation_log: Permission denied
ERROR: Failed to extract the PetaLinux installer. Failed to install PetaLinux Tools!

Any help to solve this problem will be appreciated.

When I try

sudo ./petalinux-v2018.2.ir.run /opt/petalinux_2018.2/

It also prompt with error:

ERROR: Exiting Installer: Cannot install as root user!

Best Answer

Create a directory somewhere else and install it to there:

mkdir ~/petalinux
./petalinux-*.run ~/petalinux

This is happening because non-root users cannot modify the contents of /opt and Petalinux also has a check to ensure that it's not installed by root itself since it may damage the system if used incorrectly.