2

I'm trying to install UFW on my amazon linux server with yum and here's what I'm getting:

[root@ip-XXX-31-43-YYY ~]# sudo yum install ufw
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package ufw available.
Error: Nothing to do
[root@ip-XXX-31-43-YYY ~]# 

What am I doing wrong?

I can't install via apt-get.

2 Answers 2

9

There is no ufw package for Yum.

Lighten the load on your server, and don't install a firewall on it. Instead, control which ports are open in an AWS Security Group.

0
2

Here is the easiest way to install ufw in Amazon Linux 2.

Install UFW on Amazon Linux 2

Step 1. Update Amazon Linux 2 system packages.

sudo yum update

Step 2. Install and enable epel repository on Amazon Linux 2.

sudo amazon-linux-extras install epel

Step 3. Now, install UFW.

yum install --enablerepo=epel ufw

Step 4. To check the version and installation as well, run:

ufw --version

Output:

ufw 0.35
Copyright 2008-2015 Canonical Ltd.

And B0o0ommm. UFW is installed... Here are some more steps to enable the UFW before using it.

Step 5. If the installation is fine you can enable it.

sudo ufw enable

Step 6. Check the status with:

sudo ufw status

Not the answer you're looking for? Browse other questions tagged or ask your own question.