ubuntu 安装nginx, 出现 Unable to locate package

  今天在初始化一台新的ubuntu 服务器时,敲上了 sudo apt-get install nginx 来安装nginx, 却发现提示:

   Reading package lists... Done
        Building dependency tree       
        Reading state information... Done
        E: Unable to locate package nginx

      

      然后敲上: sudo apt-get update, 这命令作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。

 然后继续 sudo apt-get install nginx. 安装完成 浏览器打开

原文地址:https://www.cnblogs.com/MrLee/p/10469580.html