【发布时间】:2017-08-18 09:05:17
【问题描述】:
我正在尝试在 ubuntu 上安装 node.js 7。在运行命令时
curl -sL https://deb.nodesource.com/setup_7.x | bash -
或
sudo curl -sL https://deb.nodesource.com/setup_7.x | bash -
我收到以下错误:
## Installing the NodeSource Node.js v7.x repo...
## Populating apt-get cache...
+ apt-get update
Reading package lists... Done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Error executing command, exiting
我也跑过:
apt-get update
这再次导致上述错误,但是当我运行sudo apt-get update
没有错误,但在运行前两个命令时再次出现错误。
我尝试过autoremovepurge 和upgrade,但问题仍然存在。
任何帮助将不胜感激
【问题讨论】: