How to fix «The specified image adapter cannot be used because of: Required PHP extension 'Imagick' was not loaded.»?

To fix it, set the «PHP GD2» value for the «ADVANCED» → «Developer» → «Image Processing Settings» → «Image Adapter» configuration option:

How to set «GD2» as the default image adapter from the command line?