docker(centos)安装vim工具
作者:互联网
目录
问题
解决
问题
利用纯净的centos镜像起了一个容器,运行vim命令的时候,提示没有该命令?这都没有,太过分了吧!!!
提示报错如下:
bash: vim: command not found
报错截图:
无奈,只有自己安装了。
其实,我一直认为vim是系统最基础的工具之一呢,就像windows系统的记事本。
没想到centos系统镜像里居然连vim都不带。
解决
既然提示没有vim工具,那就安装吧。
等等,不会连包管理工具yum都没有吧???
幸好,是有的,那就安装命令走起吧:
[root@0f49e35e0a46 config]# yum install vim-enhanced
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.bfsu.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.x86_64 2:7.4.629-8.el7_9 will be installed
--> Processing Dependency: vim-common = 2:7.4.629-8.el7_9 for package: 2:vim-enhanced-7.4.629-8.el7_9.x86_64
--> Processing Dependency: which for package: 2:vim-enhanced-7.4.629-8.el7_9.x86_64
--> Processing Dependency: libgpm.so.2()(64bit) for package: 2:vim-enhanced-7.4.629-8.el7_9.x86_64
--> Running transaction check
---> Package gpm-libs.x86_64 0:1.20.7-6.el7 will be installed
---> Package vim-common.x86_64 2:7.4.629-8.el7_9 will be installed
--> Processing Dependency: vim-filesystem for package: 2:vim-common-7.4.629-8.el7_9.x86_64
---> Package which.x86_64 0:2.20-7.el7 will be installed
--> Running transaction check
---> Package vim-filesystem.x86_64 2:7.4.629-8.el7_9 will be installed
--> Finished Dependency ResolutionDependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
vim-enhanced x86_64 2:7.4.629-8.el7_9 updates 1.1 M
Installing for dependencies:
gpm-libs x86_64 1.20.7-6.el7 base 32 k
vim-common x86_64 2:7.4.629-8.el7_9 updates 5.9 M
vim-filesystem x86_64 2:7.4.629-8.el7_9 updates 11 k
which x86_64 2.20-7.el7 base 41 kTransaction Summary
======================================================================================================================
Install 1 Package (+4 Dependent packages)Total download size: 7.1 M
Installed size: 23 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): gpm-libs-1.20.7-6.el7.x86_64.rpm | 32 kB 00:00:00
(2/5): vim-enhanced-7.4.629-8.el7_9.x86_64.rpm | 1.1 MB 00:00:01
(3/5): which-2.20-7.el7.x86_64.rpm | 41 kB 00:00:00
module.exports = {
(4/5): vim-common-7.4.629-8.el7_9.x86_64.rpm | 5.9 MB 00:00:01
(5/5): vim-filesystem-7.4.629-8.el7_9.x86_64.rpm | 11 kB 00:00:01
----------------------------------------------------------------------------------------------------------------------
Total 2.3 MB/s | 7.1 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:vim-filesystem-7.4.629-8.el7_9.x86_64 1/5
Installing : 2:vim-common-7.4.629-8.el7_9.x86_64 2/5
Installing : which-2.20-7.el7.x86_64 3/5
install-info: No such file or directory for /usr/share/info/which.info.gz
Installing : gpm-libs-1.20.7-6.el7.x86_64 4/5
Installing : 2:vim-enhanced-7.4.629-8.el7_9.x86_64 5/5
Verifying : gpm-libs-1.20.7-6.el7.x86_64 1/5
Verifying : 2:vim-enhanced-7.4.629-8.el7_9.x86_64 2/5
Verifying : which-2.20-7.el7.x86_64 3/5
Verifying : 2:vim-common-7.4.629-8.el7_9.x86_64 4/5
Verifying : 2:vim-filesystem-7.4.629-8.el7_9.x86_64 5/5Installed:
vim-enhanced.x86_64 2:7.4.629-8.el7_9Dependency Installed:
gpm-libs.x86_64 0:1.20.7-6.el7 vim-common.x86_64 2:7.4.629-8.el7_9 vim-filesystem.x86_64 2:7.4.629-8.el7_9
which.x86_64 0:2.20-7.el7Complete!
出现下图的信息,表示安装成功。
查看vim版本号信息,进一步确认。
[root@localhost ~]# vim -version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08)
Garbage after option argument: "-version"
More info with: "vim -h"
嗯,版本是7.4,应该是可以用了。
打开我刚才想编辑的auth.js文件:
哈哈,修改信息(用户名和密码)并保存,完美!
收工!!!
标签:x86,centos,629,vim,64,7.4,docker,el7 来源: https://blog.51cto.com/u_14832233/2988201