由于无法建立备份链接,Nginx不会安装

时间:2015-04-22 22:48:35

标签: ubuntu nginx vagrant

我试图在原始的ubuntu盒子上安装nginx。我使用vagrant并向ubuntu / trusty64发出''vagrant up''然后尝试安装nginx。它给出了这个错误:  在安装新版本之前无法制作`./usr/share/nginx/html/index.html'的备份链接:操作不是pe

这是完整输出:


vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 libtiff5 libvpx1 libxpm4 libxslt1.1 nginx-common
  nginx-core
Suggested packages:
  libgd-tools fcgiwrap nginx-doc
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 libtiff5 libvpx1 libxpm4 libxslt1.1 nginx
  nginx-common nginx-core
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2,704 kB of archives.
After this operation, 9,056 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package fonts-dejavu-core.
(Reading database ... 59966 files and directories currently installed.)
Preparing to unpack .../fonts-dejavu-core_2.34-1ubuntu1_all.deb ...
Unpacking fonts-dejavu-core (2.34-1ubuntu1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../fontconfig-config_2.11.0-0ubuntu4.1_all.deb ...
Unpacking fontconfig-config (2.11.0-0ubuntu4.1) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../libfontconfig1_2.11.0-0ubuntu4.1_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.11.0-0ubuntu4.1) ...
Selecting previously unselected package libjpeg-turbo8:amd64.
Preparing to unpack .../libjpeg-turbo8_1.3.0-0ubuntu2_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (1.3.0-0ubuntu2) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../libjpeg8_8c-2ubuntu8_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../libjbig0_2.0-2ubuntu4.1_amd64.deb ...
Unpacking libjbig0:amd64 (2.0-2ubuntu4.1) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../libtiff5_4.0.3-7ubuntu0.3_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.3-7ubuntu0.3) ...
Selecting previously unselected package libvpx1:amd64.
Preparing to unpack .../libvpx1_1.3.0-2_amd64.deb ...
Unpacking libvpx1:amd64 (1.3.0-2) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../libxpm4_1%3a3.5.10-1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.10-1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../libgd3_2.1.0-3_amd64.deb ...
Unpacking libgd3:amd64 (2.1.0-3) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../libxslt1.1_1.1.28-2build1_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.28-2build1) ...
Preparing to unpack .../nginx-common_1.4.6-1ubuntu3.2_all.deb ...
Unpacking nginx-common (1.4.6-1ubuntu3.2) ...
dpkg: error processing archive /var/cache/apt/archives/nginx-common_1.4.6-1ubuntu3.2_all.deb (--unpack):
 unable to make backup link of `./usr/share/nginx/html/index.html' before installing new version: Operation not permitted
Selecting previously unselected package nginx-core.
Preparing to unpack .../nginx-core_1.4.6-1ubuntu3.2_amd64.deb ...
Unpacking nginx-core (1.4.6-1ubuntu3.2) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.4.6-1ubuntu3.2_all.deb ...
Unpacking nginx (1.4.6-1ubuntu3.2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/nginx-common_1.4.6-1ubuntu3.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我有同样的问题...... 关键是错误中的这一行 -

var index = 1, // n-1 for array index notation of the second element name = "new name"; var update = { "$set": { } }, query = {}; update["$set"]["comments." + index + ".name"] = name; // Then update as normal db.posts.udate(query,update);

您可能将您的Vagrant共享目录设置为unable to make backup link of './usr/share/nginx/html/index.html'并且可能存在文件? Vagrant在其他任何事情之前设置了共享目录,并且它以root身份完成。由于权限问题,安装程序可能因备份此内容而出现问题。

我修理了:

  1. 关闭流浪汉
  2. 注释掉Vagrant文​​件中的共享目录行
  3. 重启Vagrant
  4. 安装nginx
  5. 关闭Vagrant
  6. 取消评论Vagrant文​​件中的共享行
  7. 重启Vagrant