首页
✨运维
🎉安装
👀踩坑
🤷‍♂️学习
😊关于
  • 分类
  • 标签
  • 归档
GitHub

Summer

运维界的小白
首页
✨运维
🎉安装
👀踩坑
🤷‍♂️学习
😊关于
  • 分类
  • 标签
  • 归档
GitHub
  • vim使用技巧

  • zabbix使用技巧

  • linux使用技巧

  • mysql使用技巧

  • docker使用技巧

    • 常用的docker命令
    • 配置阿里云镜像加速
    • docker容器中使用vim
      • 在使用docker容器时,有时候里边没有安装vim
    • docker虚拟化多个Centos7
  • k8s使用技巧

  • redis使用技巧

  • elasticsearch使用技巧

  • window使用技巧

  • nginx使用技巧

  • 运维
  • docker使用技巧
summer
2020-11-11

docker容器中使用vim

# 在使用docker容器时,有时候里边没有安装vim

敲vim命令时提示说:vim: command not found,这个时候就需要安装vim 可是当你敲apt-get install vim命令时,提示:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package vim
1
2
3
4

这时候需要敲:apt-get update 这个命令的作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,这样才能获取到最新的软件包。

等更新完毕以后再敲命令:apt-get install vim命令即可。

但是:实际在使用过程中,运行 apt-get update,然后执行 apt-get install -y vim,下载地址由于是海外地址,下载速度异常慢而且可能中断更新流程,所以做下面配置:

mv /etc/apt/sources.list /etc/apt/sources.list.bak
    echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
    #更新安装源
    apt-get update
1
2
3
4
5
6
7
配置阿里云镜像加速
docker虚拟化多个Centos7

← 配置阿里云镜像加速 docker虚拟化多个Centos7→

最近更新
01
redis持久化
12-08
02
redis为什么这么快
12-08
03
redis的优缺点
12-08
更多文章>
Theme by Vdoing | Copyright © 2019-2020 Evan Xu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式