Complete guide: Ubuntu 22.04 → 24.04 upgrade on DirectAdmin 1.694/1.695 — All pitfalls documented

castris

Verified User
Joined
Apr 16, 2021
Messages
161
Location
Arcenillas
Environment:
  • DirectAdmin 1.694 (upgraded to 1.695 during process)
  • CustomBuild 2.0
  • Ubuntu 22.04 LTS → 24.04 LTS
  • Services: Exim, Dovecot 2.4.2, nginx, Apache, PHP 7.4/8.0/8.1/8.2/8.3, ImageMagick 7.1.1-46, ClamAV,
    rspamd

I'm sharing this because I hit 5 different issues after the OS upgrade, some of them silent and hard to detect. Hopefully this saves someone else the pain.

TL;DR

DirectAdmin is a panel with compiled software. An OS upgrade changes system libraries. Therefore ALL compiled software must be rebuilt. The single most important command after the upgrade is:

Code:
da build all

But that's not enough. Read on.

The upgrade process

Code:
screen -S upgrade
do-release-upgrade -f DistUpgradeViewNonInteractive

Warning: Even with NonInteractive mode, dpkg conffile prompts can block the process. The pty used by dpkg is different from screen's. Monitor with:

Code:
screen -S upgrade -X hardcopy /tmp/check.txt
cat /tmp/check.txt

If stuck on a conffile prompt, respond with:

Code:
screen -S upgrade -X stuff "N\n"

This is more reliable than echo "N" > /dev/pts/X.

Issue #1 — Exim: libperl.so.5.34 not found

Symptom: Exim fails to start after reboot.
Cause: Ubuntu 24.04 ships Perl 5.38, but Exim was compiled against Perl 5.34.
Fix:
Code:
da build exim

Issue #2 — PHP-FPM (all versions): libicuio.so.70 not found

Symptom: All PHP-FPM services fail to start. Errors like:
Code:
libicuio.so.70: cannot open shared object file
undefined symbol: _ZTIN6icu_7017StringEnumerationE
Cause: Ubuntu 24.04 ships ICU 74 (was ICU 70). The C++ mangled symbols include the version number, so symlinks won't work.
Fix:
Code:
da build php n

Note: This also triggers conffile prompts when installing build dependencies (g++, libicu-dev).
Monitor the screen session.

Issue #3 — Dovecot auth: SILENT FAILURE (libldap-2.5.so.0)

This is the dangerous one.

Symptom:
systemctl is-active dovecot returns active. Dovecot appears to be running.
But NO user can authenticate. Users see "password mismatch" in their mail clients. You might think passwords were corrupted during the upgrade — they weren't.

Cause: The auth-worker binary is linked against libldap-2.5.so.0 (Ubuntu 22.04). Ubuntu 24.04 ships
libldap 2.6. The auth-worker crashes on every authentication attempt, but Dovecot's main process stays up.

How to detect:
Code:
grep "libldap" /var/log/mail.log
You'll see repeated errors every minute:
Code:
auth: Error: dovecot/auth: error while loading shared libraries: libldap-2.5.so.0: cannot open shared
  object file

Fix:
Code:
da build dovecot

Or better yet, just run da build all which covers Exim, Dovecot, PHP, nginx, and Apache in one go.

WARNING: This failure is completely silent at the service level. I only discovered it 24+ hours later when clients reported Outlook sync failures. By then I was chasing "password issues" that didn't exist. Always check mail.log for library errors after an OS upgrade.

Issue #4 — ImageMagick: libtiff.so.5 not found (NOT covered by da build all)

Symptom: All PHP versions show:

Code:
PHP Warning: Unable to load dynamic library 'imagick.so'
(libtiff.so.5: cannot open shared object file)

Running da build php_imagick enters an infinite loop — it recompiles the PHP extension but the underlying ImageMagick library is still broken.

Cause: ImageMagick is installed in /usr/local/ and compiled by CustomBuild, but da build all does NOT recompile it. There is no da build imagemagick command.

How to verify:
Code:
ldd /usr/local/lib/libMagickCore-7.Q16HDRI.so | grep "not found"

Fix — manual recompilation from CustomBuild cache:

Code:
cd /tmp
tar xzf /usr/local/directadmin/custombuild/cache/ImageMagick-*.tar.gz
cd ImageMagick-*
./configure --prefix=/usr/local \
  --with-modules --enable-shared --disable-static \
  --with-quantum-depth=16 --enable-hdri \
  --with-tiff --with-jpeg --with-png --with-webp \
  --with-freetype --with-fontconfig --with-xml
make -j$(nproc)
make install
ldconfig

Then rebuild the PHP extension:
Code:
da build php_imagick

Verify:
Code:
php -r "echo phpversion('imagick');"

Clean up:

Code:
rm -rf /tmp/ImageMagick-*

Issue #5 — ClamAV: duplicate socket drop-in

Symptom: clamav-daemon won't start. Logs show:

Code:
Failed to create listening socket (127.0.0.1:3310): Address already in use

Cause: Two drop-in files in /etc/systemd/system/clamav-daemon.socket.d/ define the same

ListenStream:
  • custombuild-tcp-socket.conf — created by CustomBuild (the legitimate one)
  • tcp.conf — leftover from before the upgrade

Fix:
Code:
rm /etc/systemd/system/clamav-daemon.socket.d/tcp.conf
systemctl daemon-reload
systemctl restart clamav-daemon.socket
systemctl start clamav-daemon

Other post-upgrade items

  • rspamd is removed during the upgrade — reinstall with apt install rspamd
  • Third-party repos are disabled — the upgrader renames them to .distUpgrade and creates .sources files with Enabled: no. You must manually re-enable, update URIs (jammy → noble, 22.04 → 24.04), and reimport GPG keys
  • /etc/pam.d/dovecot may be missing — causes PAM authentication errors for system users. Not critical for virtual mail users but should be recreated
  • Imunify360 GPG key — the official URL returns 404. Import from keyserver instead: gpg --keyserver keyserver.ubuntu.com --recv-keys BC9A243190E02617

Complete post-upgrade checklist

Code:
1.  Re-enable third-party repos (.distUpgrade → .sources with noble/24.04)
2.  Reimport GPG keys if needed (Zabbix, Imunify360)
3.  apt update (verify no repo errors)
4.  apt install rspamd (removed during upgrade)
5.  da build all (rebuilds Exim, Dovecot, PHP, nginx, Apache)
6.  Recompile ImageMagick manually (da build all does NOT cover it)
7.  da build php_imagick (after ImageMagick recompilation)
8.  Remove duplicate ClamAV drop-in if present (tcp.conf)
9.  Verify ALL services + mail authentication + imagick loads
10. Reboot (new kernel)
11. Post-reboot verification
12. Purge old kernel
13. Optional: upgrade Zabbix Agent to 7.0 LTS (backward compatible)

Key takeaway

DirectAdmin is a panel with software compiled by CustomBuild. An OS upgrade changes system libraries (Perl, ICU, libldap, libtiff, etc.), breaking every compiled binary. The fix is straightforward — da build all plus manual ImageMagick recompilation — but the failures can be silent (Dovecot auth)
or misleading (imagick infinite rebuild loop).

Run da build all immediately after the upgrade. Don't wait for users to report issues.

Hope this helps someone. Took me two days and several client complaints to document all of this. :)
 
Thanks for sharing, but 24.04 is EOL soon, why not waited for 26.0 LTS which will be releasd in April
 
Back
Top