Package ‘ufw‘ has no installation candidate问题已解决

错误提示:


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

问题描述

在 Debian系统安装 ufw 时出现上问题,执行的命令如下:

apt-get install ufw

解决方案:

  • 提示:首先更新 apt-get
apt-get update
apt-get upgrade
  • 然后在安装
apt-get install <packagename>

apt-get install ufw

ufw 命令安装

-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

防火墙命令

# 检查状态
ufw status

# 开启防火墙
ufw enable 

# 关闭防火墙
ufw disable

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

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

# 删除端口
ufw delete allow 8888

猜你喜欢

转载自blog.csdn.net/Lance_welcome/article/details/130612497
ufw