我一直在尝试使用 vmware_fusion 作为提供程序,在由 vagrant 处理的 VM 上安装项目的依赖项。
一切似乎都运行正常,但是当我尝试安装 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)
我尝试过许多建议,例如sudo apt-get -f install
或sudo apt-get upgrade
然后再试一次,但一切都因 dpkg 错误而失败。
我非常感谢任何建议!