IMEI

Automated ImageMagick compilation from sources for Debian/Ubuntu including advanced delegate support.

Download as .zip Download as .tar.gz View on GitHub

IMEI - ImageMagick Easy Install

Signed ImageMagick .deb packages for Debian and Ubuntu, with pre-built releases and local package builds.

Release Packages CI GitHub release GitHub license Plant Tree Installs

Codacy grade CodeFactor Grade


What IMEI Does

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:

In both cases, the end result is still managed by apt / dpkg, so removal stays clean.

Why IMEI Exists

IMEI is meant to solve the two common problems with ad-hoc ImageMagick install scripts:

IMEI keeps the convenience of an install script, but the actual installation happens through generated .deb packages.

Security Model

IMEI verifies signatures in two places by default:

The release install path verifies:

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:

Compatibility

Pre-built release assets are currently intended for these amd64 and arm64 targets:

Other Debian and Ubuntu systems, including Ubuntu non-LTS releases, or other architectures, can still use IMEI through local package builds.

Runtime Container

IMEI also publishes a small runtime container image built from the released ubuntu24.04 IMEI packages.

Image:

ghcr.io/softcreatr/imei-imagemagick:latest

Example:

docker run --rm ghcr.io/softcreatr/imei-imagemagick:latest -version

The container image is intentionally a secondary delivery format:

Package Layout

IMEI currently builds and installs these packages:

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.

Upgrade note:

Default Behavior

Running sudo ./imei.sh does this:

  1. verifies the installer signature
  2. detects the local Debian/Ubuntu target
  3. checks whether a matching signed pre-built release exists
  4. installs pre-built packages when a match exists
  5. otherwise falls back to a local .deb build

This means supported current targets should normally use release assets, while older or customized installs automatically drop to the local build path.

Installation

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.sh

The 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.sh

Self-Update

To update the local IMEI checkout itself:

./imei.sh --self-update

This downloads the signed IMEI runtime bundle from the selected release and updates:

User Install Mode

IMEI also supports an unprivileged source-build mode for installation into a user-owned prefix.

Example:

./imei.sh --user-install

Default user prefix:

~/.local/imei

Custom user prefix:

./imei.sh --user-install --prefix "$HOME/.opt/imei"

User-install mode:

After installation:

. "$HOME/.local/imei/imei-env.sh"

Removal:

rm -rf "$HOME/.local/imei"

Pre-Built Release Commands

Install only from release assets and fail instead of building locally:

sudo ./imei.sh --prebuilt-only

Download release packages without installing them:

sudo ./imei.sh --download-only --keep-downloads

Install 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.2

Test against a different release repository:

sudo ./imei.sh --github-repository SoftCreatR/imei-private-test

Local Build Commands

Force a local package build:

sudo ./imei.sh --build-local

Common 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-deps

PHP imagick

IMEI 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:

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 imagick

Enable 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 imagick

Restart PHP afterward:

sudo systemctl restart php"${PHP_VERSION}"-fpm

If you use Apache instead of PHP-FPM:

sudo systemctl restart apache2

Verify 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("HEI*"));'
php -r '$i = new Imagick(); print_r($i->queryFormats("AVIF"));'
php -r '$i = new Imagick(); print_r($i->queryFormats("JXL"));'

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 install

Available Installer Options

General behavior:

Installer path options:

Local build and user-install options:

Important combinations and limits:

Delegate Support

IMEI aims to build ImageMagick with as much delegate support as the target distro can reasonably provide.

Default behavior:

This keeps the intended delegate set explicit without hardcoding every distro-specific package name forever.

Private Repository Testing

IMEI can download release assets from another repository through --github-repository.

For private repositories:

Example:

export GH_TOKEN=...
sudo -E ./imei.sh --github-repository owner/private-repo

In 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.

Removal

Remove the installed IMEI packages cleanly through apt:

sudo apt remove imei-imagemagick imei-libheif imei-libjxl imei-libaom --purge

Default Versions

Operational Notes

License

ISC © 1-2.dev