E: Unable to locate package vim

报错信息

在docker的nginx容器中,向安装vim,结果报错

root@7365d9c2c7ea:/etc/nginx# apt-get install vim Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package vim

解决方案

这种方法确实比较慢,
但是如果有兴趣看下面的心酸经历,
就会明白为啥这么慢我还采取这种解决方案 . . .

apt-get update apt-get install apt-file apt-file update # now finally this will work !!! apt-get install vim

解决心酸经历之.错误套娃 . . .


尝试解决"E: Unable to locate package vim",引发新的错误"The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX"

mv /etc/apt/sources.list /etc/apt/sources.list.bak

echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

root@7365d9c2c7ea:/etc/apt# apt-get update Get:1 http://mirrors.aliyun.com/ubuntu xenial InRelease [247 kB] Get:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB] Err:1 http://mirrors.aliyun.com/ubuntu xenial InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX Err:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX Reading package lists... Done W: GPG error: http://mirrors.aliyun.com/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX E: The repository 'http://mirrors.aliyun.com/ubuntu xenial InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://mirrors.aliyun.com/ubuntu xenial-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX E: The repository 'http://mirrors.aliyun.com/ubuntu xenial-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

尝试解决"The following signatures couldn't be verified because the public key is not available: NO_PUBKEY YYYYYYYYYYYYYYYY NO_PUBKEY XXXXXXXXXXXXXXXX",引发新的错误"E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation"

//(这个公钥根据提示来写的)

gpg --keyserver keyserver.ubuntu.com --recv YYYYYYYYYYYYYYYY

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 'YYYYYYYYYYYYYYYY'

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 'XXXXXXXXXXXXXXXX'
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation


错误套娃...

死循环了?

更换源,需要"apt-get update",
"apt-get update"需要"apt-key adv --...",
但是"apt-key adv --..."需要更换源 . . . ???

算了,还是去找第一个错误"E: Unable to locate package vim"的解决方案吧 . . .

直接FQ,第一条就成功解决...(就是慢一点)

apt-get update apt-get install apt-file apt-file update apt-get install vim # now finally this will work !!!

摘抄文档

传送门.Stackexchange


__EOF__

本文作者国产凌凌漆
本文链接https://www.cnblogs.com/love-zf/p/15487892.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   zh89233  阅读(996)  评论(0)    收藏  举报
点击右上角即可分享
微信分享提示