E: Unable to locate package xxx(E: Unable to locate package xxx)

记录一下学习docker时遇到的一个小问题。

sudo apt install openjdk-8-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-8-jre-headless

原因:首次使用apt-get。需要运行apt-get update 之后方可使用。

————————

Record a small problem encountered in learning docker.

sudo apt install openjdk-8-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-8-jre-headless

< strong > reason: < / strong > apt get is used for the first time. You need to run < strong > apt get update < / strong > before using it.