How to set enable_unsafe_install ?

Hi, I want to use arduino-cli to install the adafruit/DHT-sensor-library library:

arduino-cli lib install --git-url https://github.com/adafruit/DHT-sensor-library.git

but get an information which says that --git-url and --zip-path is prohibited by default. Then I searched the doc of arduino-cli, and find:


How to set enable_unsafe_install to true by arduino-cli ?
Best regards.

Hi @wanggaoteng.

Since the library is in the Arduino Library Manager, if you only want to install a release version of the library, you can use this command without any need to source it from the Git repository:

arduino-cli lib install "DHT sensor library"

The alternative library installation sources available by using the --git-url and --zip-path commands are appropriate when you want to install a library that is not in the Arduino Library Manager, or a beta test version of the library (e.g., the version from the tip of the repository's default branch). In this case, you can enable these flags in your Arduino CLI configuration with the arduino-cli config set command:

arduino-cli config set library.enable_unsafe_install true

Hi, @ptillisch
Thanks a lot.
I use arduino-cli lib search DHT, and arduino-cli output a lot of libraries, does them are the libraries which you mean "libraries in the Arduino Library Manager" ?
Best regards.

Yes. All the libraries returned by an arduino-cli lib search query are from the Arduino Library Manager

We don't use the term "Library Manager" in the Arduino CLI documentation much for some reason, but you might be familiar with it if you ever use Arduino IDE (info here). This is Arduino's library distribution system, somewhat like pip for Python packages and npm for Node.js packages. It allows you to easily install and update any of the >5000 Arduino libraries that have been published to Library Manager, including the library dependencies.

Thanks, now I understand.

You are welcome. I'm glad if I was able to be of assistance.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.