Docker---问题1:bash: vi: command not found/bash: vim: command not found
生活随笔
收集整理的這篇文章主要介紹了
Docker---问题1:bash: vi: command not found/bash: vim: command not found
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在使用docker時(shí),有時(shí)候我們需要編輯配置文件,需要使用vim或者vi命令,發(fā)現(xiàn):
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這是因?yàn)関im沒有安裝,使用如下命令安裝:
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此時(shí)需要更新:
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) ...完成
總結(jié)
以上是生活随笔為你收集整理的Docker---问题1:bash: vi: command not found/bash: vim: command not found的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mybatis学习(13): 连接数据库
- 下一篇: 第九十四期:GitHub 发布 2019