stspringer

Update Arduino IDE 03_07_2026 script for Linux Mint PC

Jan 19th, 2026 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | Source Code | 0 0
  1. This script will update the Arduino IDE to the latest version on your Linux Mint PC. Even if you have an older version of the Arduino IDE already installed, you may still run this script, and it will update to the latest IDE. I am currently running Linux Mint ver 22.2, and my Arduino IDE is ver 2.3.7. It also updates the ESP8266 and ESP32 libraries. You can have this script in your home directory, or create a folder ~bin and put it there. The script name is "arduino_full_setup_v3_bulletproof.sh". Make sure you make it executable with chmod +x arduino_full_setup_v3_bulletproof.sh
  2. then run it ./arduino_full_setup_v3_bulletproof.sh
  3. HTH
  4.  
  5. #!/bin/bash
  6. # Arduino IDE + ESP8266 + ESP32 Full Setup (Linux Mint)
  7. # Auto-fetch latest Arduino IDE version from official Arduino software page
  8. # Updated for current release handling
  9.  
  10. set -euo pipefail
  11.  
  12. echo "------------------------------------------------------------"
  13. echo " Arduino IDE + ESP8266 + ESP32 Full Setup (Linux Mint)"
  14. echo " Auto-fetch latest Arduino IDE from official Arduino site"
  15. echo "------------------------------------------------------------"
  16.  
  17. # ============================================================
  18. # 0. PATH fix (duplicate-safe)
  19. # ============================================================
  20. grep -q 'export PATH="$HOME/bin:$PATH"' ~/.bashrc || \
  21. echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
  22. export PATH="$HOME/bin:$PATH"
  23.  
  24. mkdir -p "$HOME/Applications"
  25. mkdir -p "$HOME/.local/share/applications"
  26. mkdir -p "$HOME/bin"
  27.  
  28. # ============================================================
  29. # 1. Clean old Arduino IDE AppImages only
  30. # Leave board packages and sketchbook alone
  31. # ============================================================
  32. echo "[+] Cleaning old Arduino IDE AppImages and cache..."
  33. rm -f "$HOME"/Applications/arduino-ide_*_Linux_64bit.AppImage
  34. rm -rf "$HOME/.cache/arduino-ide" 2>/dev/null || true
  35. echo ""
  36.  
  37. # ============================================================
  38. # 2. Get latest Arduino IDE version from official Arduino page
  39. # ============================================================
  40. echo "[+] Checking latest Arduino IDE version from Arduino official site..."
  41.  
  42. SOFTWARE_PAGE="$(curl -fsSL https://www.arduino.cc/en/software)"
  43.  
  44. LATEST_VER="$(printf '%s\n' "$SOFTWARE_PAGE" \
  45. | grep -oE 'Arduino IDE[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+' \
  46. | head -n1 \
  47. | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
  48.  
  49. if [[ -z "${LATEST_VER:-}" ]]; then
  50. echo "[X] Could not detect latest Arduino IDE version from Arduino website."
  51. exit 1
  52. fi
  53.  
  54. echo "[✓] Latest Arduino IDE version detected: $LATEST_VER"
  55. echo ""
  56.  
  57. # ============================================================
  58. # 3. Download latest AppImage from Arduino CDN
  59. # ============================================================
  60. FILE_NAME="arduino-ide_${LATEST_VER}_Linux_64bit.AppImage"
  61. CDN_URL="https://downloads.arduino.cc/arduino-ide/${FILE_NAME}"
  62. DEST="$HOME/Applications/${FILE_NAME}"
  63.  
  64. echo "[+] Downloading Arduino IDE AppImage..."
  65. echo " $CDN_URL"
  66.  
  67. curl -fL --retry 3 --retry-delay 2 -o "$DEST" "$CDN_URL"
  68.  
  69. # Basic sanity check
  70. MIN_SIZE=$((150 * 1024 * 1024)) # 150 MB minimum
  71. ACTUAL_SIZE=$(stat -c%s "$DEST")
  72.  
  73. if [[ "$ACTUAL_SIZE" -lt "$MIN_SIZE" ]]; then
  74. echo "[X] Downloaded file is too small ($(du -h "$DEST" | cut -f1)). Aborting."
  75. rm -f "$DEST"
  76. exit 1
  77. fi
  78.  
  79. chmod 755 "$DEST"
  80. echo "[✓] Arduino IDE AppImage OK ($(du -h "$DEST" | cut -f1))"
  81. echo ""
  82.  
  83. # ============================================================
  84. # 4. Install libfuse2 if needed for AppImage
  85. # ============================================================
  86. if ! dpkg -s libfuse2 &>/dev/null; then
  87. echo "[+] Installing libfuse2..."
  88. sudo apt update
  89. sudo apt install -y libfuse2
  90. else
  91. echo "[✓] libfuse2 already installed."
  92. fi
  93. echo ""
  94.  
  95. # ============================================================
  96. # 5. Create desktop launcher
  97. # ============================================================
  98. echo "[+] Creating desktop launcher..."
  99.  
  100. DESKTOP_FILE="$HOME/.local/share/applications/arduino-ide.desktop"
  101.  
  102. cat <<EOF > "$DESKTOP_FILE"
  103. [Desktop Entry]
  104. Version=1.0
  105. Type=Application
  106. Name=Arduino IDE
  107. Comment=Arduino IDE
  108. Exec=$DEST --no-sandbox
  109. Icon=arduino
  110. Terminal=false
  111. Categories=Development;IDE;Electronics;
  112. StartupNotify=true
  113. EOF
  114.  
  115. chmod 644 "$DESKTOP_FILE"
  116. update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
  117.  
  118. echo "[✓] Launcher created."
  119. echo ""
  120.  
  121. # ============================================================
  122. # 6. Install Arduino CLI if missing
  123. # ============================================================
  124. if ! command -v arduino-cli &>/dev/null; then
  125. echo "[+] Installing arduino-cli..."
  126. cd /tmp
  127. curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
  128. install -m 755 /tmp/bin/arduino-cli "$HOME/bin/arduino-cli"
  129. else
  130. echo "[✓] arduino-cli already installed."
  131. fi
  132. echo ""
  133.  
  134. # ============================================================
  135. # 7. Initialize CLI config if needed
  136. # ============================================================
  137. if [[ ! -f "$HOME/.arduino15/arduino-cli.yaml" ]]; then
  138. echo "[+] Initializing Arduino CLI..."
  139. arduino-cli config init
  140. else
  141. echo "[✓] Arduino CLI already initialized."
  142. fi
  143. echo ""
  144.  
  145. # ============================================================
  146. # 8. Add ESP8266 + ESP32 board URLs
  147. # ============================================================
  148. ESP8266_URL="https://arduino.esp8266.com/stable/package_esp8266com_index.json"
  149. ESP32_URL="https://espressif.github.io/arduino-esp32/package_esp32_index.json"
  150. OLD_ESP8266_URL="http://arduino.esp8266.com/stable/package_esp8266com_index.json"
  151.  
  152. echo "[+] Configuring board manager URLs..."
  153.  
  154. # Remove old HTTP ESP8266 URL if present
  155. arduino-cli config delete board_manager.additional_urls "$OLD_ESP8266_URL" 2>/dev/null || true
  156.  
  157. # Add URLs only if missing
  158. arduino-cli config dump | grep -qF "$ESP8266_URL" || \
  159. arduino-cli config add board_manager.additional_urls "$ESP8266_URL"
  160.  
  161. arduino-cli config dump | grep -qF "$ESP32_URL" || \
  162. arduino-cli config add board_manager.additional_urls "$ESP32_URL"
  163.  
  164. echo "[✓] Board manager URLs configured."
  165. echo ""
  166.  
  167. # ============================================================
  168. # 9. Update board indexes
  169. # ============================================================
  170. echo "[+] Updating board package indexes..."
  171. arduino-cli core update-index
  172. echo ""
  173.  
  174. # ============================================================
  175. # 10. Install or upgrade ESP8266 core
  176. # ============================================================
  177. echo "[+] Installing/upgrading ESP8266 core..."
  178. if arduino-cli core list | grep -q "esp8266:esp8266"; then
  179. arduino-cli core upgrade esp8266:esp8266 || true
  180. else
  181. arduino-cli core install esp8266:esp8266
  182. fi
  183. echo ""
  184.  
  185. # ============================================================
  186. # 11. Install or upgrade ESP32 core
  187. # ============================================================
  188. echo "[+] Installing/upgrading ESP32 core..."
  189. if arduino-cli core list | grep -q "esp32:esp32"; then
  190. arduino-cli core upgrade esp32:esp32 || true
  191. else
  192. arduino-cli core install esp32:esp32
  193. fi
  194. echo ""
  195.  
  196. # ============================================================
  197. # 12. Verify installed files
  198. # ============================================================
  199. echo "[+] Verifying ESP8266 core..."
  200. find "$HOME/.arduino15/packages/esp8266" -name "ESP8266HTTPClient.h" >/dev/null 2>&1 \
  201. && echo "[✓] ESP8266 OK" \
  202. || echo "[!] ESP8266 verify check did not find ESP8266HTTPClient.h"
  203.  
  204. echo "[+] Verifying ESP32 core..."
  205. find "$HOME/.arduino15/packages/esp32" -name "WiFi.h" >/dev/null 2>&1 \
  206. && echo "[✓] ESP32 OK" \
  207. || echo "[!] ESP32 verify check did not find WiFi.h"
  208.  
  209. echo ""
  210. echo "------------------------------------------------------------"
  211. echo " INSTALLATION COMPLETE — Arduino IDE $LATEST_VER READY"
  212. echo "------------------------------------------------------------"
  213. echo " AppImage: $DEST"
  214. echo " Launcher: $DESKTOP_FILE"
  215.  
  216.  
Advertisement
Add Comment
Please, Sign In to add comment