加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

ubuntu – 为什么apt-get install要求更新nginx.conf?如何使用

发布时间:2020-12-13 21:39:34 所属栏目:Nginx 来源:网络整理
导读:我试图使用chef脚本安装几个与nginx无关的软件包(例如htop).但它失败了,因为它要求更新nginx.conf和nginx / sites-available / default.我可以选择使用厨师. (我也不想覆盖,因为我想了解并修复问题而不是逃避它) 因此我尝试通过运行命令sudo apt-get install

我试图使用chef脚本安装几个与nginx无关的软件包(例如htop).但它失败了,因为它要求更新nginx.conf和nginx / sites-available / default.我可以选择使用厨师. (我也不想覆盖,因为我想了解并修复问题而不是逃避它)

因此我尝试通过运行命令sudo apt-get install htop自行安装htop,并得到以下输出.

ubuntu@ip-10-150-4-249:~? sudo apt-get install htop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  htop
0 upgraded,1 newly installed,0 to remove and 160 not upgraded.
3 not fully installed or removed.
Need to get 68.0 kB of archives.
After this operation,188 kB of additional disk space will be used.
Get:1 http://ap-southeast-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe htop amd64 1.0.2-3 [68.0 kB]
Fetched 68.0 kB in 0s (5,762 kB/s)
Selecting previously unselected package htop.
(Reading database ... 80711 files and directories currently installed.)
Preparing to unpack .../htop_1.0.2-3_amd64.deb ...
Unpacking htop (1.0.2-3) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up nginx-common (1.8.0-1+trusty1) ...

Configuration file '/etc/nginx/nginx.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ? 

然后我尝试安装已安装的cmake sudo apt-get install vim,我仍然遇到同样的错误.输出如下

ubuntu@ip-10-162-36-233:~? sudo apt-get install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
vim is already the newest version.
0 upgraded,0 newly installed,0 to remove and 171 not upgraded.
3 not fully installed or removed.
After this operation,0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nginx-common (1.8.0-1+trusty1) ...

Configuration file '/etc/nginx/nginx.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx.conf (Y/I/N/O/D/Z) [default=N] ? 

>我想了解为什么每次都会发生这种情况?
>在这种情况发生之前,有没有办法先预防这种情况?因为它会阻止我的厨师脚本.
>我如何使用厨师解决这个问题?

最佳答案
Chef以非交互模式运行apt,因此这些提示不显示Chef的包资源,始终使用Chef部署的文件版本.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读