6

I installed ubuntu server(18.04 version) a few days ago. and I tried to install fail2ban with apt tool but couldn't do that.

Here's some information on my situation.

root@ubuntu:~# cat /etc/os-release | grep -i version
VERSION="18.04.1 LTS (Bionic Beaver)"
VERSION_ID="18.04"
VERSION_CODENAME=bionic

root@ubuntu:~# apt search fail2ban
Sorting... Done
Full Text Search... Done

Why cant' I search fail2ban on ubuntu package repository?

NoFence
  • 769
  • 1
  • 9
  • 17
  • 2
    You have "universe" disabled? It is in the package list https://packages.ubuntu.com/bionic/fail2ban and shows up when I search for it. – Rinzwind Aug 06 '18 at 07:23
  • @Rinzwind No, I touched nothing after installing ubuntu. Here's result of opening sources.list file. root@ubuntu:~# cat /etc/apt/sources.list deb http://archive.ubuntu.com/ubuntu bionic main deb http://archive.ubuntu.com/ubuntu bionic-security main deb http://archive.ubuntu.com/ubuntu bionic-updates main – NoFence Aug 06 '18 at 07:27
  • @Rinzwind I made it with your advice. Thank you for your help :) – NoFence Aug 06 '18 at 08:02
  • Excellent :-) don't forget to accept the answer when the grace period is over ;) – Rinzwind Aug 06 '18 at 08:13

1 Answers1

8

I got a solution with Rinzwind's saying. My sources.list had main repositiory list only. But fail2ban is available universe package list. So, I added universe list into sources.list with command-lines like this.

sudo add-apt-repository universe

Finally I could search fail2ban package successfully.

N0rbert
  • 97,162
  • 34
  • 239
  • 423
NoFence
  • 769
  • 1
  • 9
  • 17
  • Don't forget `sudo apt update` or like me, you'll be confused why the package can't be found for a while longer. – Kickaha Aug 08 '20 at 13:47
  • This was an issue to get fail2ban to work on Ubuntu 22.04 LTS as well. Assuming you are not root this one line command will install the repo above, update the package list, and install fail2ban ```sudo add-apt-repository universe && sudo apt update -y && sudo apt install -y fail2ban``` – Jas Panesar Jan 01 '23 at 21:15