Step 1: Download the Arduino IDE

Step 2: Extract

Go to your Downloads directory and right-click on the downloaded arduino-1.8.2-linux64.tar.xz file or whatever your file is called.
Then click extract here and wait until you see two Arduino folders.
Step 3: Open Terminal

Go to your Downloads directory with
cd Downloads
and delete the compressed file with
sudo rm -r arduino-1.8.2-linux64.tar.gz
Then move your extracted Arduino file into the opt directory with
sudo mv arduino-1.8.2 /opt
Change into /opt directory and into the Arduino folder
cd /opt/arduino-1.8.2
Edit the install.sh script with
sudo nano install.sh
Search in the script for the line “RESOURCE_NAME=cc.arduino.arduinoide” and change it to “RESOURCE_NAME=arduino-arduinoide”.
Step 4: Installation

Now make the script executable with the command
sudo chmod +x install.sh
and execute it with
./install.sh
Now you will not see any errors or bugs for the installation and you have the Arduino IDE flawlessly installed!