
在某些 Ubuntu 系統上我得到以下提示:
$ nc
Command 'nc' not found, but can be installed with:
apt install netcat-openbsd # version 1.206-1ubuntu1, or
apt install ncat # version 7.80+dfsg1-2build1
apt install netcat-traditional # version 1.10-41.1ubuntu1
是什麼產生了這些提示?
答案1
這些來自於command-not-found
公用事業它本身就在包裝中command-not-found
。
$ /usr/lib/command-not-found -- nc
如果安裝軟體包,則需要執行額外的程式apt update
來下載使用的資料庫command-not-found
(例如,從http://archive.ubuntu.com/ubuntu/dists/jammy/main/cnf/)。
UNIX & Linux StackExchange 上的這個答案解釋了它最終如何與 shell 整合。