我正在学习 Advanced Packaging Tool 的 CLI 界面。从apt(8)它的 stdout 不是终端时的输出来看,它不适合“需要稳定编程接口的脚本”,因此我正在查看apt-get(8).
apt update和之间的一个区别apt-get update是后者在所有缓存更新后缺少最后一行:
8 packages can be upgraded. Run 'apt list --upgradable' to see them.
Run Code Online (Sandbox Code Playgroud)
我想知道如何使用apt-get(8).
update-alternatives --set iptables /usr/sbin/iptables-nft通过运行并重新启动服务器,我已将 Ubuntu Focal 服务器防火墙后端从旧版 iptables 迁移到 netfilter 。现在显示的所有表iptables-legacy -S都是空的,但是当我运行iptables -S最后一行时总是显示:
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Run Code Online (Sandbox Code Playgroud)
此后我已iptables-legacy使用以下命令从替代方案中删除:
update-alternatives --remove iptables /usr/sbin/iptables-legacy
Run Code Online (Sandbox Code Playgroud)
现在只显示 netfilter 版本
root@iBug-Server:~# update-alternatives --display iptables
iptables - auto mode
link best version is /usr/sbin/iptables-nft
link currently points to /usr/sbin/iptables-nft
link iptables is /usr/sbin/iptables
slave iptables-restore is /usr/sbin/iptables-restore
slave iptables-save is /usr/sbin/iptables-save
/usr/sbin/iptables-nft - priority 20
slave iptables-restore: /usr/sbin/iptables-nft-restore
slave iptables-save: /usr/sbin/iptables-nft-save
Run Code Online (Sandbox Code Playgroud)
我怎样才能摆脱这个警告?
我正在运行适用于 Linux 的 Windows 子系统,但 Windows 控制台中的颜色很糟糕。我非常喜欢 Ubuntu 16.04 中的调色板。我已经知道如何在 Windows 控制台中更改颜色,而我所需要的只是来自 Ubuntu 终端的颜色。我使用 16.04 及其默认桌面环境 ubuntu-unity。默认终端中颜色的 RGB 值是多少?前景色和背景色。
echo -e "\e[30;1mA\e[31;1mB\e[32;1mC\e[33;1mD\e[34;1mE\e[35;1mF\e[36;1mG\e[37;1mH"
Run Code Online (Sandbox Code Playgroud) 根据Ubuntu 安全页面,linuxBionic 和 Focal 中的项目状态为“需要”。linux-generic我假设这个项目在 APT 存储库中引用,所以linuxBionic 中应该是 4.15,Focal 中应该是 5.4。我还在 Ubuntu Focal 上用(amd64)做了一个简单的测试linux-image-5.4.0-100-generic,但未能利用。因此我认为 4.15 上的 Bionic 也不受影响。
那么为什么 Bionic 和 Focal 仍然显示为“需要”呢?