For Ubuntu (might also work for Debian), I more or less follow this guide:
This installs the Arduino IDE outside of the apt package management system, so don’t install any pre-packaged versions of Arduino using the software manager or apt. It’s best to uninstall the Ubuntu packaged version if you’ve previously installed it.
When any of the sudo commands below is executed, you may be prompted to enter your login password, which you should do.
Download the latest Arduino package, Linux 32-bit or Linux 64-bit, from the official page.
Open terminal from Unity Dash, App Launcher, or via Ctrl+Alt+T keys. Do the following steps in the terminal:
Change to the directory (likely Downloads) where you downloaded the package
Decompress the downloaded archive with the tar command. Use the filename of the package you downloaded in place of arduino-1.8.3-linux64.tar.xz
tar -xvf arduino-1.8.3-linux64.tar.xz
Move the extracted folder to the /opt directory for global use. Use the name of the extracted folder in place of arduino-1.8.3
sudo mv arduino-1.8.3 /opt
Navigate to the extracted folder in its new location under /opt. Again, use the name of the extracted folder in place of arduino-1.8.3
Run the install script to create both a desktop shortcut and launcher icon:
If you’re not already a member of the dialout group, add your username to it. Use your username in place of yourname
sudo usermod -a -G dialout yourname
If you wish, you can delete the downloaded archive file to free up disk space.
You should now be able to double click on the Arduino IDE desktop icon to launch and use the IDE.
If you get an error similar to the following when attempting to upload a sketch into your Arduboy:
avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy
it’s likely that the ModemManager service is using the serial port. You probably don’t need the modem manager, so the easiest way to fix this is to disable the service:
sudo systemctl disable ModemManager.service
You only need to do this once. It’s best to re-boot your machine after this to make sure it takes effect.
If you want to upgrade to a newer version of the IDE, uninstall the current version then follow the above steps for the new version. To uninstall:
Open a terminal window as above.
Navigate to the folder, under /opt, containing the currently installed version. Use the name of the current version’s folder in place of arduino-1.8.3
Run the uninstall script to remove the desktop shortcut and launcher icon:
If you wish, you can delete the folder, under /opt containing the previous version. If you don’t delete this folder, you can run this version of the IDE by changing to this folder in terminal and entering