I am getting the above error apt running apt upgrade. This is happening on a FreePBX ISO install and a plane Debian installed with script server. I did not want to get to deep into tinkering with it such I did not torch the f2b install on the boxes. One of these is a demo I use for me the other is a production box. Thanks
Below is the full thing.
Preparing to unpack …/fail2ban_1.1.0-8_all.deb …
Unpacking fail2ban (1.1.0-8) over (1.0.2-2) …
dpkg: error processing archive /var/cache/apt/archives/fail2ban_1.1.0-8_all.deb (–unpack):
trying to overwrite ‘/etc/fail2ban/action.d/iptables-allports.conf’, which is also in package sangoma-pbx17 (2408-1.sng12)
Errors were encountered while processing:
/var/cache/apt/archives/fail2ban_1.1.0-8_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
It’s conflicting packages. Sangoma packages their own version of fail2ban and you’re trying to install the plain Debian package which is conflicting with the already installed Sangoma package.
I have the exact same issue on a plain Debian.
The problem is sangoma-pbx17 come with fail2ban configuration files but not fail2ban itself. So removing fail2ban package to install sangoma-pbx17 package result in not having fail2ban anymore.
None of those package was update recently. Note that it’s the first time I am doing a fresh FPBX 17 install, so can’t say if it was fine before.
The weird part is fail2ban files coming with the package basically state for " iptables-allports.conf" :
Obsolete: superseded by iptables[type=allports]"
and for “iptables-multiport.conf” :
Obsolete: superseded by iptables[type=multiport]
I think something got whacked up somewhere with packages. I have used FreePBX for about 15 years and do not recall running into this one. Now that typically was with their own ISO and that was mostly on CentOS so not seeing this before does not mean much.
I think I got that. I installed the dependancies package “by hand” while, In the script, they are installed by the pkg_install function which push DPkg options : apt-get -y --ignore-missing -o DPkg::Options::="--force-confnew" -o Dpkg::Options::="--force-overwrite" install "${PKG[@]}" >> "$log"
But this function conflict with apt settings :
# Setting apt configuration to always DO NOT overwrite existing configurations
aptNoOverwrite=$(grep "DPkg::options { \"--force-confdef\"; \"--force-confold\"; }" /etc/apt/apt.conf.d/00freepbx |wc -l)
if [ "0" = "${aptNoOverwrite}" ]; then
cat <<EOF >> /etc/apt/apt.conf.d/00freepbx
DPkg::options { "--force-confdef"; "--force-confold"; }
EOF
fi
So I really don’t get what’s intended here. Forcing overwrite when installing but forcing not overwriting to not make apt update break ?
The package can be held and then manual updates I would imagine to keep it just from sangoma or just save the config, force it manually to overwrite and put config back. That’s the only ways I can think to solve it for now.
A new installation immediately returns an error message when performing apt update && apt upgrade .
dpkg: Error processing archive /var/cache/apt/archives/fail2ban_1.1.0-8_all.deb (–unpack):
trying to overwrite ‘/etc/fail2ban/action.d/iptables-allports.conf’, which is also in package sangoma-pbx17 (2408-1.sng12)
Errors occurred while processing the following packages:
/var/cache/apt/archives/fail2ban_1.1.0-8_all.deb
E: Subprocess /usr/bin/dpkg returned an error code (1)
dpkg -i --force-overwrite /home/sangoma/fail2ban_1.1.0-8_all.deb
Get:1 Index of /debian stable/main amd64 fail2ban all 1.1.0-8 [466 kB]
Fetched 466 kB in 0s (5,645 kB/s)
Warning: Download is performed unsandboxed as root as file ‘/root/fail2ban_1.1.0-8_all.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
dpkg: error: cannot access archive ‘/home/sangoma/fail2ban_1.1.0-8_all.deb’: No such file or directory