Removing a library?

I was investigating a problem concerning Adafruit_BusIO. (A message that no headers files (.h) found in it. I wasn't using it and haven't done so, at least recently. So, after an hour or so of fruitless inspection of the sketch invoking the message (despite running it OK), I went to Manage Libraries with the intention of removing it as my next step.

But there is no Uninstall, Delete etc option. The version shown as Installed was 1.9.6 so I used 'Select version', chose 1.9.5 and pressed the now accessible (bold) 'Install' button. But 1.9.6 remained installed. Repeating this a few times I found that the Install button greyed again if the mouse was briefly moved.

Q1. Is it a (minor) bug? Presumably install should not be offered at all for an already installed library)?

Q2. Is it impossible to remove a library via the IDE? Can you do it only by externally using File Explorer?

Q3: Is 'Previous versions' to be used only for trouble-shooting after manually uninstalling? Otherwise why would anyone want to install an older version?

The library folder should be in the libraries folder of your sketchbook folder. Delete the folder, or, if you want to be cautious, move it somewhere else temporarily, then restart the IDE

the Library Manager only installs the libraries into your libraries folder in your sketchbook folder. you can add a library to your libraries folder and you can delete a library folder from your libraries folder

Thanks both. So the respective answers are Yes, Yes and Yes?

With the classic Arduino IDE, yes. But uninstall capability has been added in the Arduino IDE 2.x Library Manager.

However, as you noticed, Library Manager doesn't recognize a library such as your broken installation of Adafruit BusIO (likely just an empty folder) where there is no metadata (library.properties file). So it would not have offered uninstallation for that library in your case.

Even though the IDE does still support for the "legacy"/"1.0 format" libraries that don't have metadata, it was granted reluctantly at the introduction of the new format and it is likely that improving support for such libraries is not at a high priority for allocation of Arduino's development resources.

Some additional reasons:

  • Because there is a bug in the new version of the library.
  • Because the library developers made a breaking change to the API in the newer version and your sketch or library relies on the old API. (a prominent example is ArduinoJson 5 vs 6)
  • Because your code was tested with the previous version of the library and you don't feel like taking the chance that it does not work correctly with a newer version it has not been thoroughly tested against.
1 Like

Many thanks, understood, appreciate that detailed and helpful reply. Lots there I wasn’t aware of.
Terry