Solution for FreePBX 17 Installation on Debian 12 Failing After Debian 13 Release

Hello everyone,

I’ve been working through an issue with the FreePBX 17 installation script (sng_freepbx_debian_install.sh) on Debian 12. The installation was failing with dependency conflicts, specifically involving core packages like libc6.

The root cause of the problem is that the FreePBX script was adding a repository for stable Debian packages. With the recent release of Debian 13 “Trixie”, the stable repository automatically switched to the new release, causing the system to attempt a partial, incompatible upgrade.

I found a temporary solution that allows the installation to complete successfully. This fix involves editing the script to explicitly use the bookworm codename instead of stable.

The Fix

Before you run the installation script, you must edit it to correct the repository definition.

Open the script in a text editor:
vi sng_freepbx_debian_install.sh

Find the following section of code:

if [ ! “$noaac” ] ; then
add-apt-repository -y -S “deb $DEBIAN_MIRROR stable main non-free non-free-firmware” >> “$log”
fi

Change the word stable to bookworm within the add-apt-repository line. The corrected code should look like this:

if [ ! "$noaac" ] ; then
	add-apt-repository -y -S "deb $DEBIAN_MIRROR bookworm main non-free non-free-firmware" >> "$log"
fi

Save the file and exit the editor (Ctrl + X, then Y, then Enter).

You can now run the modified script on a clean Debian 12 system, and it will install successfully without the dependency conflicts.

This workaround ensures that the script uses the correct Debian 12 packages. Hopefully, this helps others who are facing the same issue until an official update to the script is released.

1 Like

Thanks @intrabasic and welcome to the forums!

There’s a GitHub issue about the install issue (yours ?) and another GitHub issue regarding a suggested fix for existing systems that you can run before the next apt update, along with an associated forum post regarding the latter for those about to upgrade their FreePBX 17 systems.

Script was updated with the fix – new installs now stick to bookworm – but previous installs may need some manual adjustment before your next system-level package apt update (which is different process than FreePBX module updates in the web GUI.)

Help. I ran apt update apt upgrade according to the instructions in the GUI and it asked to switch to trixie and I answered yes and then the upgrade failed.

The system is live with customers and has not been rebooted, asterisk is still running and the gui accessible.

Six months ago I reverted a Debian trixie to bookworm (not FreePBX) by changing the sources and some other tweaks and though I wasn’t able to get a video driver I needed to work, I converted it to a VM and reinstalled. Other than the video driver the system seems to works normally. I can’t remember the full procedure as a downgrade is not supported and I only did it out of necessity (failed video driver). I think I reverted the sources, kernel version manually, and the files /etc/os-release and debian_version. I did make an external ftp backup of ASTETCDIR.

What would be the best course of action here. I am thinking

  1. Change /etc/apt/sources … from stable to bookworm .. I have already done this.
  2. Change /etc/os-release and /etc/debian_version to match another freepbx17, we have several, which hasn’t been altered by recent apt update apt upgrade.
  3. Run apt update apt upgrade with the correct sources.
  4. Reboot when needed.

I am not any kind of expert system admin expert though I have been doing this on and off for 30 years … does this seem like it might work?

  1. Maybe check the kernel version on an unaltered system and different add the old kernel and headers, and remove the new kernel and headers.

I can’t think of what else. Please advise asap thanks!

So I took another activated FreePBX system using the same VM service as the first which was not live and ran apt update and apt ugprade and it didn’t switch to trixie/stable. Then I manually updated /etc/apt/sources to be the same as the broken live system and /etc/aptsources.list.d/* to match the broken live system. Not broken still running but we’ll call it broken. After apt update apt upgrade … it seemed to go through the same procedure as the broken system ending in.

Preparing to unpack …/489-zutty_0.16.2.20241020+dfsg1-1_amd64.deb …
Unpacking zutty (0.16.2.20241020+dfsg1-1) over (0.14.0.20230218+dfsg1-1) …
Errors were encountered while processing:
/tmp/apt-dpkg-install-4vtJtN/135-fail2ban_1.1.0-8_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Checking the kernel version …
dpkg -l | grep linux-image
rc linux-image-6.1.0-32-amd64 6.1.129-1 amd64 Linux 6.1 for 64-bit PCs (signed)
ii linux-image-6.1.0-33-amd64 6.1.133-1 amd64 Linux 6.1 for 64-bit PCs (signed)
ii linux-image-6.1.0-38-amd64 6.1.147-1 amd64 Linux 6.1 for 64-bit PCs (signed)
iU linux-image-6.12.38+deb13-amd64 6.12.38-1 amd64 Linux 6.12 for 64-bit PCs (signed)
iU linux-image-amd64 6.12.38-1 amd64 Linux for 64-bit PCs (meta-package)

The same on both systems, so I believe the test system is the same as the broken system.

Not rebooted.

So first copied /etc/os-release and /etc/debian_version back to the bookworm settings.
Then I restored the bookworm version of /etc/apt/sources.list and /etc/apt/sources.list.d/*

cat /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ bookworm main non-free-firmware
deb-src http://ftp.us.debian.org/debian/ bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://ftp.us.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://ftp.us.debian.org/debian/ bookworm-updates main non-free-firmware
cat /etc/apt/sources.list.d/archive_uri-http_deb_freepbx_org_freepbx17-prod-bookworm.list
deb [arch=amd64] http://deb.freepbx.org/freepbx17-prod bookworm main
cat archive_uri-http_ftp_debian_org_debian-bookworm.list
deb http://ftp.debian.org/debian bookworm non-free-firmware non-free main
# deb-src http://ftp.debian.org/debian bookworm non-free-firmware non-free main

Then run…
apt update
apt upgrade

I was not sure about the kernel image but the broke one was 6.1.0-37 and the test machine was 6.1.0-38. So on the test broke I changed the -38 test machine to -37.

apt install linux-image-6.1.0-37-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-6.1.0-37-amd64
I: /initrd.img is now a symlink to boot/initrd.img-6.1.0-37-amd64

reboot

After reboot the kernel was still the -38 version I am not sure why. It still booted to -38 unless I selected -37 in the grub menu. Tested and asterisk was still able to start normally.

dpkg -l | grep linux-image
apt remove linux-image-6.1.0-38-amd64
apt remove linux-image-6.12.38+deb13-amd64
apt autoremove
update-grub
reboot
asterisk -r
All okay and running.

I did have some module errors with altered files, and it was a little work to reinstall the affected modules, but after fixing those the system looks like a clean install.

When the Sangoma team understand who Sid is and how Debian ‘rolls’, these effups will hopefully stop. They should read and watch "Toy-Story"s a few times and be prepared to answer questions :wink:

Trixie is just “A dinosaur down the street” but bookworm had a library.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.