1. Introduction

We might want to remove Arduino from our system. Perhaps we want a fresh re-install or simply no longer need it. While there are multiple methods available for this, uninstalling it sometimes leaves residual packages and files.

In this tutorial, we’ll look at a few ways to ensure a complete uninstallation of Arduino depending on how we initially installed it.

2. Removing Arduino Installed Using APT

If we’ve installed Arduino using APT, we’ll also need to use APT to remove it from our system. We’ll use the following command to confirm if Arduino is installed using APT:

$ apt list --installed | grep arduino

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

arduino-builder/jammy,now 1.3.25-3 amd64 [installed,auto-removable]
arduino-core-avr/jammy,jammy,now 1.8.4+dfsg1-1 all [installed,auto-removable]
arduino-ctags/jammy,now 5.8-arduino11-1 amd64 [installed,auto-removable]

As we can see the above listing includes the Arduino package, which verifies that Arduino has been installed with APT.

Now, let’s uninstall Arduino using the apt remove command:

$ sudo apt remove -y arduino

The above command removes the Arduino package but not the associated configuration files. If we want to remove Arduino completely along with configuration files, we’ll need to run this instead:

$ sudo apt purge -y arduino
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  arduino-builder arduino-core-avr arduino-ctags avr-libc avrdude binutils-avr ca-certificates-java default-jre
  default-jre-headless extra-xdg-menus fonts-dejavu-extra gcc-avr java-common java-wrappers libapache-pom-java
  libastylej-jni libatk-wrapper-java libatk-wrapper-java-jni libbatik-java libbcpg-java libbcprov-java
  libcommons-codec-java libcommons-compress-java libcommons-exec-java libcommons-io-java libcommons-lang3-java
  libcommons-logging-java libcommons-net-java libcommons-parent-java libftdi1 libgoogle-gson-java libhidapi-libusb0
  libhttpclient-java libhttpcore-java libjackson2-annotations-java libjackson2-core-java libjackson2-databind-java
  libjaxp1.3-java libjmdns-java libjna-java libjna-jni libjna-platform-java libjsch-java libjssc-java libjzlib-java
  liblightcouch-java liblistserialsj-dev liblistserialsj1 liblog4j2-java libmongodb-java librsyntaxtextarea-java
  librxtx-java libsemver-java libserialport0 libslf4j-java libusb-0.1-4 libxalan2-java libxerces2-java
  libxml-commons-external-java libxml-commons-resolver1.1-java libxmlgraphics-commons-java openjdk-11-jre
  openjdk-11-jre-headless
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  arduino*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 9,138 kB disk space will be freed.
(Reading database ... 265913 files and directories currently installed.)
Removing arduino (2:1.8.19+dfsg1-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...

This will remove the Arduino package and all the configuration files associated with it.

Furthermore, during the Arduino installation, it automatically installs certain packages as dependencies. To remove these packages as well, we can run:

$ sudo apt autoremove -y

Altogether, we can also use the single command to remove Arduino completely along with configuration files and dependencies:

$ sudo apt remove --purge --autoremove arduino

This will purge the Arduino package along with the config files and dependencies that are installed with it.

3. Removing Arduino Installed by Snap

If we’ve installed any package in our Linux system using Snap, we’ll also need to use the snap command to remove it. To verify if Arduino is installed by Snap, we can use:

$ snap list arduino
Name     Version  Rev  Tracking       Publisher      Notes
arduino  1.8.19   85   latest/stable  snapcrafters✪  -

If the Arduino application is installed using Snap on our system, we’ll see it listed in the output of the above command.

As we can see in the above output that it’s a Snap application. Now, let’s remove it from our Linux system using the snap remove command:

$ sudo snap remove arduino 
arduino removed

This will completely remove the Arduino snap from the system.

4. Removing Arduino Installed with Flatpak

Similarly, if we’ve installed Arduino on our Linux system using Flatpak, we’ll also need to remove it using the Flatpak.

Firstly, we’ll check if Arduino is installed with Flatpak by using:

$ flatpak list | grep arduino
Arduino LLC    cc.arduino.arduinoide    1.8.19    stable    system

If the Arduino application is listed in the output, it means it’s a Flatpak application.

Now, to remove the Arduino Flatpak application, we can use:

$ sudo flatpak uninstall cc.arduino.arduinoide

        ID                           Branch        Op
 1. [-] cc.arduino.arduinoide        stable        r
Uninstalling…
Note that '/var/lib/flatpak/exports/share' is not in the search path
set by the XDG_DATA_HOME and XDG_DATA_DIRS
environment variables, so applications may not
be able to find it until you set them. The
directories currently searched are:

- /root/.local/share
        ID                           Branch        Op
 1. [-] cc.arduino.arduinoide        stable        r

Uninstall complete.

This command will remove Arduino Flatpak from our system.

5. Removing Arduino Installed Manually Using tarball

When we install Arduino via tarball, we first extract the compressed file to a folder and then install it by running an install script inside the extracted folder. The extracted folder also contains an uninstall script that we can use to remove the Arduino application.

Let’s uninstall Arduino using the uninstall script. To do this, first we navigate into the extracted Arduino directory using:

$ cd arduino-(version number)

In our case, the version number of Arduino is arduino-1.8.12:

$ cd arduino-1.8.12/

Next, if we list files in this directory, we’ll see an uninstall.sh script.

$ ls
arduino          arduino-linux-setup.sh  hardware    java  libraries  revisions.txt  tools-builder
arduino-builder  examples                install.sh  lib   reference  tools          uninstall.sh

Now, to remove Arduino from our system, we’d need to run this script using:

$ ./uninstall.sh 
Removing desktop shortcut and menu item for Arduino IDE...

 done!

This script will remove Arduino desktop shortcuts and menu items from our system.

Afterwards, we can also remove the extracted Arduino directory using:

$ sudo rm -r arduino-1.8.12

Now we’ve removed Arduino installed manually using the tarball.

6. Removing Additional Files

All the above methods remove the Arduino package and its configuration files. However, these methods do not remove some additional files such as sketchbook, libraries, etc. We will need to manually remove them.

The sketchbook and libraries are usually in the /home/user/Arduino. Let’s remove these files using:

$ sudo rm -r /home/user/Arduino

Similarly, another folder contains board packages and tools. We can remove that folder using:

$ sudo rm -r /home/user/.arduino15

This method will remove all the traces of the Arduino application from our system.

7. Conclusion

In this article, we’ve discussed various methods to remove Arduino completely from a Linux system. The choice of method depends on how we’ve initially installed Arduino such as using APT, Snap, Flatpak, or manual installation.

Complete removal of Arduino includes uninstalling the package and all associated files such as configuration files, dependencies, and libraries.

This ensures a clean removal of the Arduino application and facilitates a clean re-installation if needed.