E:无法在Debian jessie简化的Docker容器上找到vim软件包


22

从运行jessie的Debian docker容器中我得到

vi blah
bash: vi: command not found

所以自然而然地到达了我的安装命令

sudo apt-get install vim

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vim

在寻找牵引力时,我遇到了这些建议以及各种输出

        cat /etc/apt/sources.list
deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian jessie-updates main
deb http://security.debian.org jessie/updates main

        apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package software-properties-common

        apt-get install python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-software-properties


        apt-get install apt-file
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package apt-file

由于此服务器是mongo映像的docker容器,因此它故意是Debian的裸露安装...安装vi只是在开发期间进行

Answers:


47

我找到了这个解决方案

apt-get update

apt-get install apt-file

apt-file update

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

这是上面的副本N粘贴版本

apt-get update && apt-get install apt-file -y && apt-file update && apt-get install vim -y

3
完美..只是盲目地遵循了这些步骤..它起作用了..
raksja

1
最后一行节省了我的时间,谢谢……这是第二次……这个答案帮助了我
saber tabatabaee yazdi '19

1
这对我来说很棒。apt-get update那时候我所要做的就是apt-get install ...
Jeff Whiting

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.