无法在Ubuntu 16.04上安装nginx(usr / bin / dpkg错误)

我一直试图在一个由vagrant处理的虚拟机上安装一个项目的依赖项,使用vmware_fusion作为提供者。

一切似乎工作正常,但只要我尝试安装nginx或sqlite3,我得到这样的输出:

vagrant@vagrant:~$ sudo apt-get -f install Reading package lists... Done Building dependency tree
Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: nginx-common Suggested packages: fcgiwrap nginx-doc The following NEW packages will be installed: nginx-common 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 262 not fully installed or removed. Need to get 0 B/46.4 kB of archives. After this operation, 168 kB of additional disk space will be used. Do you want to continue? [Y/n] Preconfiguring packages ... (Reading database ... 51773 files and directories currently installed.) Preparing to unpack .../nginx-common_1.11.5-0+xenial3_all.deb ... Unpacking nginx-common (1.11.5-0+xenial3) ... dpkg: error processing archive /var/cache/apt/archives/nginx-common_1.11.5-0+xenial3_all.deb (--unpack): error creating directory './var/www/html': Permission denied Processing triggers for ufw (0.35-0ubuntu2) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for systemd (229-4ubuntu13) ... Errors were encountered while processing: /var/cache/apt/archives/nginx-common_1.11.5-0+xenial3_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试了许多build议,例如sudo apt-get -f installsudo apt-get upgrade然后再次尝试,但是在dpkg错误上一切都失败。

我真的很感激任何build议!