Package 'ufw' has no installation candidate issue has been resolved

Error message:


Reading package lists… Done
Building dependency tree… Done
Package aptitude 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 has no installation candidate

Problem Description

The above problem occurred when installing on the Debian system ufw. The command executed is as follows:

apt-get install ufw

solution:

  • Tip: Update firstapt-get
apt-get update
apt-get upgrade
  • Then install
apt-get install <packagename>

apt-get install ufw

ufw command installation

-bash/zsh: ufw command not found
 
# Debian
apt-get install ufw
 
# Ubuntu
apt-get install ufw
 
# Arch Linux
pacman -S ufw
 
# Kali Linux
apt-get install ufw
 
# Fedora
dnf install ufw
 
# Raspbian
apt-get install ufw

firewall commands

# 检查状态
ufw status

# 开启防火墙
ufw enable 

# 关闭防火墙
ufw disable

# 开启指定tcp或者udp端口
ufw allow 22/tcp

# 同时开启tcp与udp端口
ufw allow 8888

# 删除端口
ufw delete allow 8888

Guess you like

Origin blog.csdn.net/Lance_welcome/article/details/130612497
Recommended