Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upgrade 0.9.3 to 0.10 on ubuntu 16.04.5 LTS? #2308

Closed
WeirdPhrog opened this issue Dec 19, 2018 · 4 comments
Closed

How to upgrade 0.9.3 to 0.10 on ubuntu 16.04.5 LTS? #2308

WeirdPhrog opened this issue Dec 19, 2018 · 4 comments

Comments

@WeirdPhrog
Copy link

WeirdPhrog commented Dec 19, 2018

Hello. Ubuntu 16.04.5 contains only 0.9.3 and I don't know how to upgrade fail2ban to 0.10 with ipv6 support without any bugs and repositary changes. https://packages.ubuntu.com/xenial/fail2ban

Please help.

@sebres
Copy link
Contributor

sebres commented Dec 19, 2018

As correct noted in #2148 and others:

Distro package maintainers are responsible for distro packaging.

You may try to find some repository (e. g. neurodebian, launchpad, etc) that contains fail2ban could be installed on Ubuntu (16.04).
No idea which best repo it could be (just google).

The way for manual installation is described on the README, Installation section as well as in the wiki (e. g. How to test newer fail2ban version resp. use fail2ban standalone instance).

Although the default version is debian-friendly, it may not have your distro-specified configs/paths (and services), so:

  • may be merge with debian-branch would be good idea;
  • backup your old /etc/fail2ban (as well as init.d script and/or systemd-unit) before you uninstall it;
  • uninstall your stock version;
  • install fail2ban manually (see instruction in README, Installation section);
  • the system init/service script is not automatically installed, so to enable fail2ban as an automatic service, simply copy the script for your distro from the files directory to /etc/init.d or related systemd-unit (see instruction in README, Installation section).
  • restore your distro-related configs or newest from new versions of new distro-packets or adjust the file from github (like /etc/fail2ban/paths-debian.conf).

That's it.

@billynoah
Copy link

Here's a step by step of what I did to make this work:

# REMOVE FAIL2BAN COMPLETELY AND BACKUP EXISTING INSTALL
service fail2ban stop
cp -a /etc/fail2ban/ /etc/fail2ban_backup/
apt-get remove --auto-remove fail2ban
apt-get purge --auto-remove fail2ban
rm -r /etc/fail2ban/

# DOWNLOAD NEWER RELEASE AND INSTALL MANUALLY
wget https://github.com/fail2ban/fail2ban/archive/0.10.4.tar.gz
tar xzf 0.10.4.tar.gz
cd fail2ban-0.10.4/
python setup.py install

# PUT UBUNTU SPECIFIC FILES INTO PLACE
cp files/bash-completion /etc/bash_completion.d/fail2ban
cp man/*.5 /usr/share/man/man5
cp man/*.1 /usr/share/man/man1
wget -O /etc/logrotate.d/fail2ban https://raw.githubusercontent.com/fail2ban/fail2ban/debian/debian/fail2ban.logrotate
cp build/fail2ban.service /lib/systemd/system/fail2ban.service
systemctl enable fail2ban
service rsyslog restart
service fail2ban start
service fail2ban status

Now enable some jails or copy rules from your old jail.local or jail.conf files and you should be in business.

@IRGeekSauce
Copy link

This did exactly what I was needing!

@sebres
Copy link
Contributor

sebres commented Apr 28, 2021

BTW, there is a wiki article for this - How to install or upgrade fail2ban manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants