900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > Docker---问题1:bash: vi: command not found/bash: vim: command not found

Docker---问题1:bash: vi: command not found/bash: vim: command not found

时间:2020-01-22 15:25:04

相关推荐

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 foundroot@64801a03b121:/etc/nginx/conf.d# vim default.conf bash: vim: command not found

这是因为vim没有安装,使用如下命令安装:

root@64801a03b121:/etc/nginx/conf.d# apt-get install vimReading package lists... DoneBuilding dependency tree Reading state information... DoneE: Unable to locate package vim

此时需要更新:

root@64801a03b121:/etc/nginx/conf.d# apt-get updateGet:1 http://security-/debian-security buster/updates InRelease [39.1 kB] Get:2 http://cdn-fastly./debian buster InRelease [122 kB] Get:4 http://security-/debian-security buster/updates/main amd64 Packages [112 kB]Get:3 http://cdn-fastly./debian buster-updates InRelease [49.3 kB]Get:5 http://cdn-fastly./debian buster/main amd64 Packages [7899 kB]Get:6 http://cdn-fastly./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 vimReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following additional packages will be installed:libgpm2 vim-common vim-runtime xxdSuggested packages:gpm ctags vim-doc vim-scriptsThe following NEW packages will be installed:libgpm2 vim vim-common vim-runtime xxd0 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] yGet:1 http://cdn-fastly./debian buster/main amd64 xxd amd64 2:8.1.0875-5 [140 kB]Get:2 http://cdn-fastly./debian buster/main amd64 vim-common all 2:8.1.0875-5 [195 kB]Get:3 http://cdn-fastly./debian buster/main amd64 libgpm2 amd64 1.20.7-5 [35.1 kB] Get:4 http://cdn-fastly./debian buster/main amd64 vim-runtime all 2:8.1.0875-5 [5775 kB]Get:5 http://cdn-fastly./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 installedSelecting 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 existProcessing triggers for libc-bin (2.28-10) ...

完成

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。