Batch image work gets tedious when every resize, conversion, thumbnail, or watermark has to pass through a graphical editor. To install ImageMagick on Rocky Linux, use the EPEL package so DNF handles the command-line tools, libraries, and updates through the normal system package workflow.
Rocky Linux 10 currently installs ImageMagick 7, where magick is the main command. Rocky Linux 9 and 8 currently install ImageMagick 6, where convert, identify, and mogrify remain the portable commands. A separate source-build path can help systems that need a current upstream ImageMagick 7 build without replacing DNF-owned commands.
Install ImageMagick on Rocky Linux
ImageMagick is packaged for Rocky Linux through EPEL, not the default BaseOS or AppStream repositories. Use the capitalized RPM package name, ImageMagick; lowercase imagemagick returns a DNF package-name error even though that spelling is common on Debian-family systems.
For most systems, the EPEL package is the clean default because it receives updates through DNF and keeps files under package-manager ownership. Source archives are available from the official ImageMagick download page; when you need that path, keep the build under a versioned /usr/local prefix with a separate update and removal workflow. PHP users looking for imagick are asking for a separate PHP extension path; start with installing PHP on Rocky Linux before adding PHP-specific modules.
Update Rocky Linux Packages
Refresh package metadata and apply pending system updates before adding EPEL:
sudo dnf upgrade --refresh
Commands that start with
sudoneed an administrator account. If your account cannot usesudo, switch to a root shell before running the package-management steps.
Enable EPEL for ImageMagick
Install the EPEL repository package for Rocky Linux from the default extras repository:
sudo dnf install epel-release
Confirm that the EPEL repository is enabled:
dnf repolist --enabled | grep -E '^epel[[:space:]]'
Relevant output includes the matching EPEL repository for your Rocky Linux major release:
epel Extra Packages for Enterprise Linux 9 - x86_64
Rocky Linux 10 prints the EPEL 10 repository name, while Rocky Linux 8 prints the EPEL 8 repository name. The important part is that the enabled repository ID starts with epel.
Install the ImageMagick Package
Install the main ImageMagick package with its exact RPM package name:
sudo dnf install ImageMagick
Verify that DNF installed the main package and library package:
rpm -q ImageMagick ImageMagick-libs
Relevant output on Rocky Linux 10 includes the ImageMagick 7 package branch:
ImageMagick-7.1.1.47-1.el10_1.x86_64 ImageMagick-libs-7.1.1.47-1.el10_1.x86_64
Rocky Linux 9 and 8 currently report ImageMagick 6 packages instead:
ImageMagick-6.9.13.25-1.el9.x86_64 ImageMagick-libs-6.9.13.25-1.el9.x86_64
Verify ImageMagick Commands
Rocky Linux 10 provides the ImageMagick 7 wrapper and still includes the legacy command names for compatibility:
command -v magick
magick --version | head -n 1
command -v convert
/usr/bin/magick Version: ImageMagick 7.1.1-47 Q16-HDRI x86_64 22763 https://imagemagick.org /usr/bin/convert
Rocky Linux 9 and 8 provide ImageMagick 6, so convert is the expected command and magick is not installed by the EPEL package:
command -v convert
convert --version | head -n 1
command -v magick || echo "magick command is not installed"
/usr/bin/convert Version: ImageMagick 6.9.13-25 Q16 x86_64 18639 https://legacy.imagemagick.org magick command is not installed
Compare ImageMagick Branches on Rocky Linux
| Rocky Linux Release | EPEL Branch | Main Commands | Policy File |
|---|---|---|---|
| Rocky Linux 10 | ImageMagick 7.1.x | magick, plus legacy commands such as convert | /etc/ImageMagick-7/policy.xml |
| Rocky Linux 9 | ImageMagick 6.9.x | convert, identify, mogrify | /etc/ImageMagick-6/policy.xml |
| Rocky Linux 8 | ImageMagick 6.9.x | convert, identify, mogrify | /etc/ImageMagick-6/policy.xml |
Use magick for new Rocky Linux 10 scripts. Use convert, identify, and mogrify when you need commands that work unchanged on Rocky Linux 9 and 8.
Install ImageMagick Development Headers on Rocky Linux
Skip this package for normal image conversion, resizing, and batch processing. Install ImageMagick-devel only when compiling software that needs MagickWand or MagickCore headers and pkg-config metadata. Debian-family package names such as libmagickwand-dev or imagemagick-6-common do not apply to Rocky Linux; the RHEL-family development package is ImageMagick-devel.
sudo dnf install ImageMagick-devel
Confirm the MagickWand development metadata is available:
pkg-config --modversion MagickWand
pkg-config --libs MagickWand
Relevant output on Rocky Linux 10 uses the ImageMagick 7 library names:
7.1.1 -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
Rocky Linux 9 and 8 currently report the ImageMagick 6 development branch:
6.9.13 -lMagickWand-6.Q16 -lMagickCore-6.Q16
Build ImageMagick from Source on Rocky Linux
Use a source build only when the EPEL package branch or delegate set does not meet the workload. The workflow follows ImageMagick’s official source installation process, but installs into a versioned prefix such as /usr/local/imagemagick-7.1.2-22 and exposes the binary as magick-source. This keeps the source-built command separate from the DNF-managed magick, convert, and library packages.
Source builds are outside DNF ownership. Keep the EPEL package for normal systems, and use
magick-sourceonly when you intentionally need the source-built ImageMagick 7 command.
Install Source Build Dependencies
Install the build tools and delegate development packages from the default Rocky Linux 10, 9, and 8 repositories. This source build does not require CRB or PowerTools. If Git is not already part of your workflow, the Rocky Linux Git installation guide covers that tool separately.
sudo dnf install git gcc gcc-c++ make pkgconf-pkg-config libjpeg-turbo-devel libpng-devel libtiff-devel libwebp-devel freetype-devel fontconfig-devel libxml2-devel zlib-devel bzip2-devel xz-devel
Create the ImageMagick Source Update Helper
Create a helper script that can install the first source build and later update it. The script resolves stable ImageMagick tags, refuses unexpected existing paths, installs under /usr/local/imagemagick-<version>, updates /usr/local/imagemagick-current, and links the command as /usr/local/bin/magick-source.
sudo tee /usr/local/bin/update-imagemagick-source > /dev/null <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
REPO_URL="https://github.com/ImageMagick/ImageMagick.git"
WORKDIR="${HOME}/imagemagick-source-build"
SOURCE_DIR="${WORKDIR}/source"
BUILD_DIR="${WORKDIR}/build"
PREFIX_BASE="/usr/local"
CURRENT_LINK="${PREFIX_BASE}/imagemagick-current"
COMMAND_LINK="${PREFIX_BASE}/bin/magick-source"
LDCONFIG_FILE="/etc/ld.so.conf.d/imagemagick-source.conf"
REQUESTED_TAG="${1:-}"
if [ "$(id -u)" -eq 0 ]; then
echo "Run this command as a regular user, not as root."
exit 1
fi
for cmd in git grep sed awk gcc g++ make pkg-config sudo; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Missing required command: $cmd"
echo "Install the source-build prerequisites, then run this command again."
exit 1
fi
done
if [ -n "$REQUESTED_TAG" ]; then
LATEST_TAG="$REQUESTED_TAG"
else
echo "Resolving the latest ImageMagick release tag..."
LATEST_TAG=$(git ls-remote --tags --sort=-version:refname "$REPO_URL" 'refs/tags/[0-9]*' |
sed -n 's#.*refs/tags/##p' |
grep -E '^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$' |
head -n 1 || true)
fi
if [ -z "${LATEST_TAG:-}" ]; then
echo "Could not determine an ImageMagick release tag."
exit 1
fi
if ! printf '%s\n' "$LATEST_TAG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$'; then
echo "Release tag does not match the expected ImageMagick stable tag format: $LATEST_TAG"
exit 1
fi
CURRENT_VERSION="none"
if [ -x "${CURRENT_LINK}/bin/magick" ]; then
CURRENT_VERSION=$("${CURRENT_LINK}/bin/magick" --version 2>/dev/null | awk '/^Version:/ {print $3; exit}' || true)
CURRENT_VERSION="${CURRENT_VERSION:-none}"
fi
printf 'Current source version: %s\n' "$CURRENT_VERSION"
printf 'Target source version: %s\n' "$LATEST_TAG"
if [ "$CURRENT_VERSION" = "$LATEST_TAG" ]; then
echo "Already up to date."
exit 0
fi
INSTALL_PREFIX="${PREFIX_BASE}/imagemagick-${LATEST_TAG}"
if [ -e "$CURRENT_LINK" ] && [ ! -L "$CURRENT_LINK" ]; then
echo "Refusing to replace non-symlink path: $CURRENT_LINK"
exit 1
fi
if [ -e "$COMMAND_LINK" ] && [ ! -L "$COMMAND_LINK" ]; then
echo "Refusing to replace non-symlink command: $COMMAND_LINK"
exit 1
fi
sudo true
mkdir -p "$WORKDIR"
if [ -d "${SOURCE_DIR}/.git" ]; then
if [ -n "$(git -C "$SOURCE_DIR" status --porcelain --untracked-files=no)" ]; then
echo "Tracked source changes found in $SOURCE_DIR; commit or remove them before updating."
exit 1
fi
echo "Updating existing ImageMagick source checkout..."
git -C "$SOURCE_DIR" fetch --depth 1 origin "refs/tags/${LATEST_TAG}:refs/tags/${LATEST_TAG}"
git -C "$SOURCE_DIR" -c advice.detachedHead=false checkout --quiet "$LATEST_TAG"
else
echo "Cloning ImageMagick $LATEST_TAG source..."
git clone --depth 1 --branch "$LATEST_TAG" "$REPO_URL" "$SOURCE_DIR"
fi
git -C "$SOURCE_DIR" describe --tags --exact-match >/dev/null
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
echo "Configuring ImageMagick for ${INSTALL_PREFIX}..."
"${SOURCE_DIR}/configure" \
--prefix="$INSTALL_PREFIX" \
--without-perl \
--without-x \
--disable-dependency-tracking
echo "Compiling ImageMagick (this can take several minutes)..."
make -j"$(nproc)"
echo "Installing ImageMagick under ${INSTALL_PREFIX}..."
sudo make install
sudo ln -sfn "$INSTALL_PREFIX" "$CURRENT_LINK"
sudo ln -sfn "${CURRENT_LINK}/bin/magick" "$COMMAND_LINK"
printf '%s\n' "${CURRENT_LINK}/lib" | sudo tee "$LDCONFIG_FILE" >/dev/null
sudo ldconfig
echo "ImageMagick source build is ready:"
"$COMMAND_LINK" --version | head -n 1
EOF
Make the helper executable. The chmod command controls this permission bit.
sudo chmod 0755 /usr/local/bin/update-imagemagick-source
command -v update-imagemagick-source
/usr/local/bin/update-imagemagick-source
Run the Source Build Helper
Pin the validated ImageMagick release for the first build so the result is reproducible. Later updates can omit the tag after you are ready to build the newest stable release resolved from the upstream Git tags.
update-imagemagick-source 7.1.2-22
Relevant output includes the resolved version, build prefix, and final ImageMagick version:
Current source version: none Target source version: 7.1.2-22 Cloning ImageMagick 7.1.2-22 source... Configuring ImageMagick for /usr/local/imagemagick-7.1.2-22... Compiling ImageMagick (this can take several minutes)... Installing ImageMagick under /usr/local/imagemagick-7.1.2-22... ImageMagick source build is ready: Version: ImageMagick 7.1.2-22 Q16-HDRI x86_64 bbfc7cba0:20260511 https://imagemagick.org
Verify Source-Built ImageMagick
Use magick-source when you want the source-built binary:
magick-source --version | head -n 1
magick-source logo: /tmp/imagemagick-source-logo.webp
magick-source identify -format "%m %w %h\n" /tmp/imagemagick-source-logo.webp
Version: ImageMagick 7.1.2-22 Q16-HDRI x86_64 bbfc7cba0:20260511 https://imagemagick.org WEBP 640 480
Remove the temporary verification image after the check:
rm -f /tmp/imagemagick-source-logo.webp
Use ImageMagick on Rocky Linux
ImageMagick includes a built-in logo: image, which makes quick command checks easy without downloading a sample file. These commands create a PNG file, resize it to WebP, and print the final format and dimensions.
Run ImageMagick 7 Commands on Rocky Linux 10
magick logo: logo.png
magick logo.png -resize 120x120 logo-small.webp
magick identify -format "%m %w %h\n" logo-small.webp
WEBP 120 90
Run ImageMagick 6 Commands on Rocky Linux 9 and 8
convert logo: logo.png
convert logo.png -resize 120x120 logo-small.webp
identify -format "%m %w %h\n" logo-small.webp
WEBP 120 90
For larger batch jobs, be careful with mogrify. It modifies matching files in place, so test on copies or keep a backup before resizing or converting a whole directory.
Troubleshoot ImageMagick on Rocky Linux
Most Rocky Linux ImageMagick issues come from EPEL not being enabled, the capitalized RPM package name, ImageMagick 6 versus 7 command differences, or delegate support that differs by release.
Fix No Match for imagemagick
With EPEL metadata available, the lowercase Debian-style package name fails and DNF points to the capitalized RPM package name:
sudo dnf install imagemagick
No match for argument: imagemagick * Maybe you meant: ImageMagick Error: Unable to find a match: imagemagick
If EPEL is not enabled yet, you may see only a no-match error without the suggestion. Enable EPEL if needed, then install the capitalized package name:
sudo dnf install epel-release
sudo dnf install ImageMagick
Fix magick Command Not Found
On Rocky Linux 9 and 8, magick: command not found is expected after installing the EPEL package because those releases use ImageMagick 6. Use convert for the same basic conversion workflow:
convert --version | head -n 1
On Rocky Linux 10, check whether the package is installed if magick is missing:
rpm -q ImageMagick
Check Image Format Support
Use ImageMagick’s format list when a file type fails with a missing delegate message. The grep command filters the long format list to common web and camera formats.
# Rocky Linux 10
magick identify -list format | grep -Ei 'HEIC|JXL|WEBP|PNG|JPEG'
# Rocky Linux 9 and 8
identify -list format | grep -Ei 'WEBP|PNG|JPEG'
Rocky Linux 10 currently shows WebP and JPEG XL support after the package install, and EPEL also publishes an optional ImageMagick-heic package for that release. Rocky Linux 9 and 8 currently show common formats such as JPEG, PNG, and WebP, but they do not expose the same ImageMagick 7 plugin package surface. Check the format list on the target system before relying on specialized formats such as HEIC, PDF, or camera RAW files.
Check Source Build Delegate Support
If the source-built command cannot read or write an expected format, inspect the configure summary from magick-source. Missing delegates usually mean the related -devel package was not present before the build; install the missing dependency, then rerun update-imagemagick-source 7.1.2-22 or your chosen tag.
magick-source -list configure | grep -E '^(DELEGATES|FEATURES|PREFIX)'
DELEGATES bzlib fontconfig freetype jng jpeg lzma png ps tiff webp xml zlib FEATURES Channel-masks(32-bit) Cipher DPC HDRI OpenMP PREFIX /usr/local/imagemagick-7.1.2-22
Find ImageMagick policy.xml
ImageMagick’s policy.xml file controls security restrictions, resource limits, and some Ghostscript-related behavior. Locate the package-managed file before editing it:
rpm -ql ImageMagick-libs | grep '/policy.xml$'
Rocky Linux 10 uses the ImageMagick 7 policy path:
/etc/ImageMagick-7/policy.xml
Rocky Linux 9 and 8 use the ImageMagick 6 policy path:
/etc/ImageMagick-6/policy.xml
Back up the file before making policy changes, especially on systems that process untrusted images. ImageMagick documents the available policy controls in its security policy reference.
Handle dnf config-manager Command Not Found
The EPEL package workflow does not need dnf config-manager. If another repository task asks you to enable CRB or PowerTools and the command is missing, install the DNF plugins package first:
sudo dnf install dnf-plugins-core
Update or Remove ImageMagick on Rocky Linux
Update ImageMagick with DNF
Normal system upgrades include ImageMagick updates from EPEL. To check the ImageMagick package directly, ask DNF for available updates:
dnf check-update ImageMagick
Apply an available ImageMagick update with:
sudo dnf upgrade ImageMagick
Update Source-Built ImageMagick
If you used the source-build helper, run it again when you want to move that separate build to a newer upstream release. With no argument, the helper resolves the latest stable ImageMagick tag from the project repository; pass a tag only when you want to rebuild a specific release.
update-imagemagick-source
When the source build already matches the newest resolved tag, the helper stops before rebuilding:
Current source version: 7.1.2-22 Target source version: 7.1.2-22 Already up to date.
Remove ImageMagick Packages
Remove the main package with DNF. If ImageMagick-devel is installed, DNF removes it as a dependent package and reviews unused dependencies in the same transaction.
sudo dnf remove ImageMagick
Check that the main and development packages are gone:
rpm -q ImageMagick ImageMagick-devel || true
package ImageMagick is not installed package ImageMagick-devel is not installed
Remove Source-Built ImageMagick
The source method uses a versioned prefix and a current symlink so removal can stay targeted. The guard refuses to remove anything unless /usr/local/imagemagick-current points to an expected ImageMagick source-build directory.
SOURCE_PREFIX=$(readlink -f /usr/local/imagemagick-current 2>/dev/null || true)
case "$SOURCE_PREFIX" in
/usr/local/imagemagick-[0-9]*)
sudo rm -f /usr/local/bin/magick-source
sudo rm -f /usr/local/bin/update-imagemagick-source
sudo rm -f /etc/ld.so.conf.d/imagemagick-source.conf
sudo rm -f /usr/local/imagemagick-current
sudo rm -rf "$SOURCE_PREFIX" "$HOME/imagemagick-source-build"
sudo ldconfig
;;
"")
echo "No ImageMagick source symlink found"
;;
*)
echo "Refusing to remove unexpected path: $SOURCE_PREFIX"
exit 1
;;
esac
Confirm that the source-built command is gone:
command -v magick-source || echo "magick-source removed"
magick-source removed
Optional EPEL Cleanup
Leave EPEL enabled if any other installed packages come from that repository. Check first:
dnf repoquery --installed --qf '%{name} %{from_repo}' | grep ' epel$' || echo "No installed packages from EPEL found"
If no installed packages depend on EPEL, check whether the repository package is still installed:
rpm -q epel-release || true
If that check reports an installed epel-release package and you enabled EPEL only for ImageMagick, remove it:
sudo dnf remove epel-release
Verify EPEL is no longer enabled:
dnf repolist --enabled | grep -E '^epel[[:space:]]' || echo "EPEL is not enabled"
EPEL is not enabled
Conclusion
ImageMagick is ready on Rocky Linux for shell-based image conversion, thumbnail generation, resizing, and scripted batch processing, with DNF handling the normal EPEL package path. Use magick on Rocky Linux 10, keep convert for Rocky Linux 9 and 8 compatibility, and reserve magick-source for systems that intentionally need a current upstream ImageMagick 7 build outside package-manager ownership.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><blockquote>quote</blockquote>