Docker---问题1:bash: vi: command not found/bash: vim: command not found
在使用docker时,有时候我们需要编辑配置文件,需要使用vim或者vi命令,发现:
root@64801a03b121:/etc/nginx/conf.d# vi default.conf
bash: vi: command not found
root@64801a03b121:/etc/nginx/conf.d# vim default.conf
bash: vim: command not found
这是因为vim没有安装,使用如下命令安装:
root@64801a03b121:/etc/nginx/conf.d# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vim
此时需要更新:
root@64801a03b121:/etc/nginx/conf.d# apt-get update
Get:1 http://security-cdn.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian buster InRelease [122 kB]
Get:4 http://security-cdn.debian.org/debian-security buster/updates/main amd64 Packages [112 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease [49.3 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian buster/main amd64 Packages [7899 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian buster-updates/main amd64 Packages [5792 B]
Fetched 8226 kB in 5min 26s (25.2 kB/s)
Reading package lists... Done
再次安装:
root@64801a03b121:/etc/nginx/conf.d# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:libgpm2 vim-common vim-runtime xxd
Suggested packages:gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:libgpm2 vim vim-common vim-runtime xxd
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7425 kB of archives.
After this operation, 33.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cdn-fastly.deb.debian.org/debian buster/main amd64 xxd amd64 2:8.1.0875-5 [140 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian buster/main amd64 vim-common all 2:8.1.0875-5 [195 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libgpm2 amd64 1.20.7-5 [35.1 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian buster/main amd64 vim-runtime all 2:8.1.0875-5 [5775 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian buster/main amd64 vim amd64 2:8.1.0875-5 [1280 kB]
Fetched 7425 kB in 5min 53s (21.1 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package xxd.
(Reading database ... 7203 files and directories currently installed.)
Preparing to unpack .../xxd_2%3a8.1.0875-5_amd64.deb ...
Unpacking xxd (2:8.1.0875-5) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a8.1.0875-5_all.deb ...
Unpacking vim-common (2:8.1.0875-5) ...
Selecting previously unselected package libgpm2:amd64.
Preparing to unpack .../libgpm2_1.20.7-5_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.7-5) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a8.1.0875-5_all.deb ...
Adding 'diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.1.0875-5) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.1.0875-5_amd64.deb ...
Unpacking vim (2:8.1.0875-5) ...
Setting up libgpm2:amd64 (1.20.7-5) ...
Setting up xxd (2:8.1.0875-5) ...
Setting up vim-common (2:8.1.0875-5) ...
Setting up vim-runtime (2:8.1.0875-5) ...
Setting up vim (2:8.1.0875-5) ...
...
...
...
update-alternatives: warning: skip creation of /usr/share/man/man1/editor.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group editor) doesn't exist
Processing triggers for libc-bin (2.28-10) ...
完成
Docker---问题1:bash: vi: command not found/bash: vim: command not found相关推荐
- docker基础容器中bash: vi: command not found问题解决
docker基础容器中bash: vi: command not found问题解决 问题 我们在创建基础容器之后,进入容器,进行编辑配置文件的时候,需要使用vim或者vi命令,但是会出现: 原因 这 ...
- 解决:bash: vim: command not found、docker 容器不识别 vi / vim 、docker 容器中安装 vim
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1. 在 Docker 容器中编辑文件,报错如下: bash: vim: command not f ...
- bash: vi: command not found
新进入一个docker的时候,没有vi命令,这种情况已经遇见好几次了,记录一下. vi train_mv2.py bash: vi: command not found 按照网上的方法,运行apt-g ...
- Mac 终端命令行报错 -bash: vi: command not found
我遇到的问题与这个类似,但是我的问题也是用该博文作者方法进行中断才解决的,在此表示感谢. 前段时间在 Mac 下使用终端遇到了这个问题: appledeMacBook-Air:~ air$ vi .b ...
- docker容器里无法使用vi命令
在部署项目到docker容器里的tomcat,我们经常需要修改相关配置文件,有的时候会发现vi命令无法使用. bash: vi: command not found 解决办法 apt-get upda ...
- bash: vim: command not found
在 Docker 容器中编辑文件,报错如下: bash: vim: command not found 解决方案: apt-get update apt-get install vim
- -bash: vim: command not found 两种解决方法
[现象] [root@i-j9fgvzkr ffmpeg-4.1]# vim /etc/ld.so.conf -bash: vim: command not found [解决方法1]使用vi /et ...
- Docker容器中没有vi/ps等命令
1 背景及原因 Docker中安装容器后,进入容器内,想要执行一些命令,却发现根本没有这个命令. Docker容器都是最小化的Linux,所以有很多命令没有. 2 解决 # 进入容器内 docker ...
- macos -bash: yarn: command not found/-bash: cnpm: command not found
博客主要更新地址:?https://www.cnblogs.com/niceyoo -bash: cnpm: command not found -bash: yarn: command not fo ...
最新文章
- OpenCV——图像的平移旋转
- 网络工程师_要记录下来的一些题_3
- 如何在内嵌 css 中编写: hover_优秀 CSS 代码的 8 个编写技巧!
- XtraBackup做mysql主从同步
- php 正则获取数字,php结合正则获取字符串中数字的几种方法
- 我有做短视频的freestyle,要来一起吗?
- 发现一个ps抠毛发简单快捷高质量的方法
- ThoughtWorks技术雷达专区
- mysql 转换编码
- sklearn常用函数(更新中)
- PAT 1037. 在霍格沃茨找零钱
- Gvim 在进行文件对比时报cannot read or write temp files
- DC、HDC和CDC的区别及MFC常见类的作用
- 网上订餐系统需求分析报告
- 数据血缘关系图 工具_MCGS组态软件实现数据报表
- 2022危险化学品生产单位安全生产管理人员考试题库及在线模拟考试
- 南邮JAVA程序设计实验3 流处理程序设计
- javascript之键盘事件
- 计算机屏幕黑屏让程序继续允许,电脑软件让对方黑屏
- 如何做一份淹没的水深分布图