E: Package 'ufw' has no installation candidate on Debian Linux

I am trying to set up ufw on Debian and getting error:

root@localhost:~# apt install ufw
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ufw is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ufw' has no installation candidate

What could cause such error on newly installed VM?

I am an idiot. I did not updated my package database. So I did

sudo apt update
Get:1 http://mirrors.linode.com/debian buster InRelease [122 kB]
Get:2 http://mirrors.linode.com/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://mirrors.linode.com/debian buster-updates InRelease [51.9 kB]
Get:4 http://mirrors.linode.com/debian buster/main Sources [7,841 kB]
Get:5 http://mirrors.linode.com/debian buster/main amd64 Packages [7,907 kB]
Get:6 http://mirrors.linode.com/debian buster/main Translation-en [5,969 kB]
Get:7 http://mirrors.linode.com/debian-security buster/updates/main Sources [179 kB]
Get:8 http://mirrors.linode.com/debian-security buster/updates/main amd64 Packages [268 kB]
Get:9 http://mirrors.linode.com/debian-security buster/updates/main Translation-en [142 kB]
Get:10 http://mirrors.linode.com/debian buster-updates/main Sources [4,328 B]
Get:11 http://mirrors.linode.com/debian buster-updates/main amd64 Packages [9,504 B]
Get:12 http://mirrors.linode.com/debian buster-updates/main Translation-en [6,834 B]
Fetched 22.6 MB in 5s (4,565 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
16 packages can be upgraded. Run 'apt list --upgradable' to see them.

Now installation done and error went away:

sudo apt install ufw

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
ufw
0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded.
Need to get 164 kB of archives.
After this operation, 852 kB of additional disk space will be used.
Get:1 http://mirrors.linode.com/debian buster/main amd64 ufw all 0.36-1 [164 kB]
Fetched 164 kB in 0s (9,067 kB/s)
Preconfiguring packages …
Selecting previously unselected package ufw.
(Reading database … 29331 files and directories currently installed.)
Preparing to unpack …/archives/ufw_0.36-1_all.deb …
Unpacking ufw (0.36-1) …
Setting up ufw (0.36-1) …

Creating config file /etc/ufw/before.rules with new version

Creating config file /etc/ufw/before6.rules with new version

Creating config file /etc/ufw/after.rules with new version

Creating config file /etc/ufw/after6.rules with new version
Created symlink /etc/systemd/system/multi-user.target.wants/ufw.service → /lib/systemd/system/ufw.service.
Processing triggers for man-db (2.8.5-2) …
Processing triggers for rsyslog (8.1901.0-1) …
Processing triggers for systemd (241-7~deb10u6) …


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki