最近在學習docker時,由於docker維護的dockerHub遠程倉庫的鏡像文件比普通的文件小得多,所以經常碰到的情況是,一般常用的命令,會出現no command的情況。今天安裝ping的時候就出現問題了
ping的安裝命令:
apt-get install -y inetutils-ping
root@ee413c6798e5:/# apt-get install inetutils-ping Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package inetutils-ping
正確的操作是;
1)這時候需要敲:apt-get update,這個命令的作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,這樣才能獲取到最新的軟件包。 2)等更新完畢以后再敲命令:apt-get install iputils-ping命令即可。