我这样写:
sudo apt-get update && apt-get install curl
Run Code Online (Sandbox Code Playgroud)
并得到这个输出:
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Run Code Online (Sandbox Code Playgroud)
然后我写这个:
须藤rm /var/lib/apt/lists/lock
须藤rm /var/cache/apt/archives/lock
然后我重复安装 cURL 并得到这个:
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Run Code Online (Sandbox Code Playgroud)
更新:
输出
$ sudo apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
curl
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 179 kB of archives.
After this operation, 373 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
curl
Install these packages without verification [y/N]? y
Err http://archive.ubuntu.com/ubuntu/ natty-updates/main curl i386 7.21.3-1ubuntu1.2
404 Not Found [IP: 91.189.91.14 80]
Err http://security.ubuntu.com/ubuntu/ natty-security/main curl i386 7.21.3-1ubuntu1.2
404 Not Found [IP: 91.189.88.149 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.21.3-1ubuntu1.2_i386.deb 404 Not Found [IP: 91.189.88.149 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Run Code Online (Sandbox Code Playgroud)
——
更新 2:
我使用的是Linux Mint 11 (Rosinka),并且已连接到 Internet。
您在那里运行两个单独的命令:apt-get update
和apt-get install curl
. 在&&
简单地连接两个命令,它的意思是“运行的第二个如果第一个成功了。这两个命令都需要运行作为root用户,这是通过追加做sudo
给他们,但你仅与运行的第一个sudo
,而不是第二,你要找的是
sudo apt-get update && sudo apt-get install curl
Run Code Online (Sandbox Code Playgroud)
此外,似乎还有其他东西在后台安装。停止可能正在使用的任何其他进程dpkg
。最后,由于您还收到有关未下载某些索引文件的错误,请删除&&
. 而是运行:
sudo apt-get update; sudo apt-get install curl
Run Code Online (Sandbox Code Playgroud)