IMEI installs ImageMagick and selected delegate libraries as proper Debian packages instead of running make install directly on the target system.
That gives you two installation paths:
- pre-built signed
.debpackages for supported release targets - local package builds for older systems or custom build options
In both cases, the end result is still managed by apt / dpkg, so removal stays clean.
IMEI is meant to solve the two common problems with ad-hoc ImageMagick install scripts:
- building everything on the target machine can take too long
- hand-installed files are hard to remove cleanly later
IMEI keeps the convenience of an install script, but the actual installation happens through generated .deb packages.
IMEI verifies signatures in two places by default:
- the local
imei.shscript verifies itself againstimei.sh.sig - pre-built release installs verify signed release metadata before any
.debis installed
The release install path verifies:
release-manifest.envSHA256SUMS- the downloaded package hashes listed in
SHA256SUMS
IMEI supports key rotation through the files in keys/. New signatures can point to a specific public key by key id, while older signatures can still be preserved in the keyring.
Notes:
--no-sig-verifydisables only installer self-verification and is intended for local development or recovery cases- self-update only trusts release bundles signed by a key that already exists in the local keyring
- if you rotate to a brand-new key that is not yet trusted locally, one manual keyring refresh is still required once
Pre-built release assets are currently intended for these amd64 targets:
- Debian 11 (Bullseye)
- Debian 12 (Bookworm)
- Debian 13 (Trixie)
- Ubuntu 22.04 (Jammy Jellyfish)
- Ubuntu 22.10 (Kinetic Kudu)
- Ubuntu 23.04 (Lunar Lobster)
- Ubuntu 23.10 (Mantic Minotaur)
- Ubuntu 24.04 (Noble Numbat)
- Ubuntu 24.10 (Oracular Oriole)
- Ubuntu 25.04 (Plucky Puffin)
- Ubuntu 25.10 (Questing Quokka)
- Ubuntu 26.04 (Resolute Raccoon)
Older Debian and Ubuntu systems can still use IMEI through local package builds.
IMEI currently builds and installs these packages:
imei-libaomimei-libheifimei-libjxlimei-imagemagick
The private runtime stack is installed below /opt/imei.
imei-imagemagick exposes the CLI tools through /usr/bin, while the delegate libraries remain under /opt/imei so IMEI does not overwrite distro libaom, libheif, or libjxl packages.
Running sudo ./imei.sh does this:
- verifies the installer signature
- detects the local Debian/Ubuntu target
- checks whether a matching signed pre-built release exists
- installs pre-built packages when a match exists
- otherwise falls back to a local
.debbuild
This means supported current targets should normally use release assets, while older or customized installs automatically drop to the local build path.
The primary install path is the one-step bootstrap launcher:
t=$(mktemp) && \
wget 'https://dist.1-2.dev/imei.sh' -qO "$t" && \
bash "$t" && \
rm "$t"Manual verification of the bootstrap launcher still works too:
wget https://dist.1-2.dev/imei.sh && \
wget https://dist.1-2.dev/imei.sh.sig && \
wget https://dist.1-2.dev/imei.sh.pem && \
openssl dgst -sha512 -verify imei.sh.pem -signature imei.sh.sig imei.shThe bootstrap launcher first tries to fetch the signed IMEI runtime bundle from the release assets. If that bundle is unavailable, it falls back to the repository source tree on main, where IMEI then follows its normal behavior: use pre-built packages when available, otherwise build locally.
If you want to pass options through the one-step installer, append them after bash "$t":
t=$(mktemp) && \
wget 'https://dist.1-2.dev/imei.sh' -qO "$t" && \
bash "$t" --build-local && \
rm "$t"Manual checkout install:
git clone https://github.com/SoftCreatR/imei && \
cd imei && \
chmod +x imei.sh && \
sudo ./imei.shTo update the local IMEI checkout itself:
./imei.sh --self-updateThis downloads the signed IMEI runtime bundle from the selected release and updates:
imei.shscripts/*versions/*- the public keyring in
keys/*
IMEI also supports an unprivileged source-build mode for installation into a user-owned prefix.
Example:
./imei.sh --user-installDefault user prefix:
~/.local/imeiCustom user prefix:
./imei.sh --user-install --prefix "$HOME/.opt/imei"User-install mode:
- does not use
aptordpkg - does not install system-wide files under
/usr/bin - does not provide package-managed removal
- expects the required system build dependencies to already be installed
After installation:
. "$HOME/.local/imei/imei-env.sh"Removal:
rm -rf "$HOME/.local/imei"Install only from release assets and fail instead of building locally:
sudo ./imei.sh --prebuilt-onlyDownload release packages without installing them:
sudo ./imei.sh --download-only --keep-downloadsInstall from a specific release tag:
sudo ./imei.sh --release-tag im-7.1.2-18_aom-3.13.2_heif-1.21.2_jxl-0.11.2Test against a different release repository:
sudo ./imei.sh --github-repository SoftCreatR/imei-private-testForce a local package build:
sudo ./imei.sh --build-localCommon examples:
sudo ./imei.sh --build-local --imagemagick-version 7.1.2-18
sudo ./imei.sh --build-local --aom-version 3.13.2
sudo ./imei.sh --build-local --libheif-version 1.21.2
sudo ./imei.sh --build-local --jpeg-xl-version 0.11.2
sudo ./imei.sh --build-local --imagemagick-quantum-depth 8
sudo ./imei.sh --build-local --imagemagick-opencl
sudo ./imei.sh --build-local --imagemagick-build-static
sudo ./imei.sh --build-local --imagemagick-with-magick-plus-plus
sudo ./imei.sh --build-local --imagemagick-with-perl
sudo ./imei.sh --build-local --disable-delegate raqm
sudo ./imei.sh --build-local --skip-jpeg-xl
sudo ./imei.sh --build-local --work-dir /tmp/imei-build
sudo ./imei.sh --build-local --output-dir /tmp/imei-dist
sudo ./imei.sh --build-local --keep-build-depsIMEI does not ship a separate php-imagick package. To make PHP use the IMEI ImageMagick installation, rebuild the imagick extension against /opt/imei.
Important notes:
- the distro
php-imagickpackage is usually built against the distro ImageMagick libraries, not IMEI imagickuses MagickCore and MagickWand, not Magick++, so--imagemagick-with-magick-plus-plusis not required- after upgrading IMEI to a newer ImageMagick release, rebuild the PHP
imagickextension too
Recommended path with PECL:
sudo apt install php-dev php-pear pkg-config
sudo apt remove php-imagick --purge || true
sudo pecl uninstall imagick || true
sudo pecl channel-update pecl.php.net
export PKG_CONFIG_PATH=/opt/imei/lib/pkgconfig
export CPPFLAGS="-I/opt/imei/include"
export LDFLAGS="-L/opt/imei/lib -Wl,-rpath,/opt/imei/lib"
printf "\n" | sudo -E pecl install imagickEnable the extension if PECL did not already do it:
PHP_VERSION="$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;')"
echo "extension=imagick.so" | sudo tee "/etc/php/${PHP_VERSION}/mods-available/imagick.ini" >/dev/null
sudo phpenmod imagickRestart PHP afterward:
sudo systemctl restart php"${PHP_VERSION}"-fpmIf you use Apache instead of PHP-FPM:
sudo systemctl restart apache2Verify that PHP is using the IMEI build:
php --ri imagick
php -r '$i = new Imagick(); print_r($i->getVersion());'
php -r '$i = new Imagick(); print_r($i->queryFormats("HEIC"));'
magick -list format | grep -E '(^|[[:space:]])(HEIC|HEIF|AVIF|JXL)\*?[[:space:]]'If pecl install imagick still links against the wrong ImageMagick, build it manually:
sudo apt install php-dev pkg-config
sudo apt remove php-imagick --purge || true
pecl download imagick
tar -xf imagick-*.tgz
cd imagick-*/
phpize
export PKG_CONFIG_PATH=/opt/imei/lib/pkgconfig
export CPPFLAGS="-I/opt/imei/include"
export LDFLAGS="-L/opt/imei/lib -Wl,-rpath,/opt/imei/lib"
./configure --with-php-config="$(command -v php-config)"
make -j"$(nproc)"
sudo make installGeneral behavior:
- without any options,
sudo ./imei.shverifies the installer, detects the local target, prefers a matching signed pre-built release, and falls back to a local package build if no supported release asset exists - most build-specific flags force the local build path automatically, because a published pre-built package cannot be reconfigured on the target machine
Installer path options:
--build-localForces a local build instead of using release assets. Default: off.--user-installUses the unprivileged source-build backend and installs into a user-owned prefix such as~/.local/imei. Default: off.--prebuilt-onlyRestricts IMEI to release assets and fails if no exact pre-built target is available. Default: off.--download-onlyDownloads the selected release assets but does not install them. Default: off.--self-updateUpdates the local IMEI checkout itself from the signed self-update bundle instead of installing ImageMagick. Default: off.--download-dir <dir>Uses a custom directory for downloaded release assets. Default: a temporary directory.--keep-downloadsPreserves downloaded release assets after install or download-only mode completes. Default: off.--no-sig-verifySkips only the localimei.shself-signature check. Release metadata verification still applies to pre-built installs. Default: off.--release-tag <tag>Installs or downloads assets from a specific GitHub release tag instead oflatest. Default: latest release.--github-repository <owner/repo>Uses another GitHub repository as the release source. Default:SoftCreatR/imei.--target <target>Overrides automatic target detection. Mainly useful for testing, CI, or release-asset inspection. Default: detected local target.--helpPrints the built-in command help and exits.
Local build and user-install options:
--prefix <dir>Overrides the install prefix for--user-install. Default:~/.local/imei. In the normal package-managed path, IMEI still installs under/opt/imei.--imagemagick-version <version>Builds a specific ImageMagick release instead of the version pinned inversions/imagemagick.--aom-version <version>Builds a specificlibaomrelease instead of the pinned default.--libheif-version <version>Builds a specificlibheifrelease instead of the pinned default.--jpeg-xl-version <version>Builds a specificlibjxlrelease instead of the pinned default.--imagemagick-quantum-depth <n>Sets the ImageMagick quantum depth. Valid values:8,16,32. Default:16.--imagemagick-openclEnables OpenCL support in the local ImageMagick build. Default: off.--imagemagick-build-staticBuilds ImageMagick static instead of shared. Default: shared build.--imagemagick-with-magick-plus-plusBuilds the Magick++ C++ interface in the local ImageMagick build. Default: off for faster builds.--imagemagick-with-perlBuilds PerlMagick in the local ImageMagick build. Default: off for faster builds.--disable-delegate <name>Disables a specific ImageMagick delegate from IMEI's default delegate set. Can be passed multiple times. Default: no delegates disabled.--skip-aomSkips buildinglibaom. Default: off. This also requires skippinglibheif, because IMEI'slibheifbuild expects the IMEIlibaomstack.--skip-libheifSkips buildinglibheifand theheicdelegate path. Default: off.--skip-jpeg-xlSkips buildinglibjxland thejxldelegate path. Default: off.--work-dir <dir>Uses a custom build workspace instead of IMEI's temporary work directory.--output-dir <dir>Writes generated.debfiles to a custom directory during local package builds. Default:dist/<target>.--no-installBuilds the local.debpackages without installing them afterward. Only applies to the package-build path, not--user-install.--keep-build-depsKeeps the temporary build dependencies that IMEI installed for the local package build. Default: off. Without this flag, IMEI removes build-only packages it introduced after a successful local build.--keep-work-dirKeeps the build workspace after completion for debugging or inspection. Default: off.
Important combinations and limits:
--user-installcannot be combined with--prebuilt-onlyor--download-only--user-installcannot be combined with--output-diror--no-install--prebuilt-onlyis useful when you want a hard failure instead of a surprise local compile- any option that changes build features, versions, delegates, or install style should be treated as a local-build request
IMEI aims to build ImageMagick with as much delegate support as the target distro can reasonably provide.
Default behavior:
- delegates are enabled by default
- local builds can disable specific delegates explicitly with
--disable-delegate <name> - dependency installation and ImageMagick configure flags are driven from the shared delegate policy in
scripts/delegates.sh
This keeps the intended delegate set explicit without hardcoding every distro-specific package name forever.
IMEI can download release assets from another repository through --github-repository.
For private repositories:
GH_TOKENis preferredGITHUB_TOKENalso works- when using
sudo, preserve the environment withsudo -E
Example:
export GH_TOKEN=...
sudo -E ./imei.sh --github-repository owner/private-repoIn GitHub Actions, GITHUB_TOKEN is available automatically, but it still needs to be passed into the shell environment when a workflow step runs the script.
Remove the installed IMEI packages cleanly through apt:
sudo apt remove imei-imagemagick imei-libheif imei-libjxl imei-libaom --purge- ImageMagick version:
7.1.2-18 (Q16) - libaom version:
3.13.2 - libheif version:
1.21.2 - libjxl version:
0.11.2
imei-imagemagickis intended to be mutually exclusive with distro ImageMagick command packages. If stock ImageMagick is already installed,aptmay remove it to install IMEI. Installing stock ImageMagick afterward may removeimei-imagemagickfor the same reason. Use--user-installif you need IMEI without taking over/usr/bin.- pre-built release assets are target-specific; if no exact match exists, IMEI falls back to a local build unless
--prebuilt-onlyis set - release metadata must match the published asset filenames exactly, so release generation normalizes filenames before creating the manifest and checksums
--user-installis a separate source-build backend and intentionally does not try to behave like a package-managed install