Docker容器解决没有vi/vim命令问题
Posted chenglei1208
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker容器解决没有vi/vim命令问题相关的知识,希望对你有一定的参考价值。
在进入docker启动的容器中,需要修改配置文件信息,但是发现vi命令不识别,解决办法
1.进入容器
docker exec -it 719f072af9d0 /bin/bash
2.命令:apt-get install vim
如果出现如下
root@719f072af9d0:/usr/local/tomcat/webapps/web_demo# apt-get install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package vim
3.命令:apt-get update
出现如下
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:4 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Reading package lists... Done
E: Release file for http://deb.debian.org/debian/dists/bullseye-updates/InRelease is not valid yet (invalid for another 6d 12h 41min 35s). Updates for this repository will not be applied.
E: Release file for http://security.debian.org/debian-security/dists/bullseye-security/InRelease is not valid yet (invalid for another 6d 11h 42min 9s). Updates for this repository will not be applied.
4.命令:apt-get install vim 再次执行一次
OK完成
以上是关于Docker容器解决没有vi/vim命令问题的主要内容,如果未能解决你的问题,请参考以下文章