To install the Arduino IDE using the command line interface (CLI) on an Ubuntu-based system, you can follow these steps:
Step 1: Update Package Lists
First, update your package lists to ensure you have the latest information on available packages.
bash
sudo apt update
Step 2: Install Dependencies
Install some necessary dependencies that Arduino IDE might require.
bash
sudo apt install -y curl gnupg lsb-release
Step 3: Add Arduino PPA (Optional but Recommended)
Adding the Arduino PPA ensures you get the latest version of the Arduino IDE.
bash
curl -sSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
Step 4: Install Arduino IDE
You can install Arduino IDE using either snap or by downloading it directly. Here are both methods:
Method 1: Using Snap
-
Install Snapd if it’s not already installed.
bash
sudo apt install snapd
-
Install Arduino IDE using Snap.
bash
sudo snap install arduino
Method 2: Downloading Directly
-
Download the Arduino IDE AppImage.
bash
wget https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.3-linux64.AppImage -O arduino-ide.AppImage
-
Make the downloaded AppImage executable.
bash
chmod +x arduino-ide.AppImage
-
Move it to a directory in your PATH or run it directly.
bash
sudo mv arduino-ide.AppImage /usr/local/bin/arduino-ide
Step 5: Launch Arduino IDE
You can now launch the Arduino IDE from the CLI.
Or, if you installed it via Snap:
bash
snap run arduino
Step 6: (Optional) Create a Desktop Shortcut
If you want to create a desktop shortcut for easier access, you can create a .desktop file.
bash
echo "[Desktop Entry]
Name=Arduino IDE
Exec=/usr/local/bin/arduino-ide
Icon=/usr/local/bin/arduino-ide/arduino.png
Type=Application
Categories=Development;" > ~/.local/share/applications/arduino-ide.desktop
This will create a desktop entry that you can find in your application menu.
That’s it! You’ve successfully installed the Arduino IDE on your Ubuntu system using the CLI.