Over the past couple of days, I have been trying to install Fail2Ban on my Ubuntu server. I am continuously having problems installing. I have tried so many routes to fix this, but with no success. Each time I try to install the program, I get an error / suggestion that I need to fix the broken install. When I follow the instructions to fix it, I get an error. The code below is what I am getting.
root@ubuntu-s-2vcpu-2gb-nyc1-01:~# sudo apt install fail2ban
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libc6-dev : Depends: libc-dev-bin (= 2.31-0ubuntu9.7) but 2.31-0ubuntu9.2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@ubuntu-s-2vcpu-2gb-nyc1-01:~# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
python3-acme python3-certbot python3-configargparse python3-future python3-icu python3-josepy python3-mock
python3-parsedatetime python3-pbr python3-pyparsing python3-requests-toolbelt python3-rfc3339 python3-tz
python3-zope.component python3-zope.event python3-zope.hookable
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libc-dev-bin
The following packages will be upgraded:
libc-dev-bin
1 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.
1 not fully installed or removed.
Need to get 0 B/71.6 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 135346 files and directories currently installed.)
Preparing to unpack .../libc-dev-bin_2.31-0ubuntu9.7_amd64.deb ...
Unpacking libc-dev-bin (2.31-0ubuntu9.7) over (2.31-0ubuntu9.2) ...
dpkg: error processing archive /var/cache/apt/archives/libc-dev-bin_2.31-0ubuntu9.7_amd64.deb (--unpack):
unable to create '/usr/bin/gencat.dpkg-new' (while processing './usr/bin/gencat'): Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/libc-dev-bin_2.31-0ubuntu9.7_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)