返回首页DA系统C#IDE文件同步服务屏保 今天是: 2026-05-05    "立夏"  夏季的第一个节气,表示盛夏时节的正式开始

搜索
热搜: linux 技术
Hi~登录注册
查看: 1696|回复: 0

[转载] 【转载】Docker容器中安装vim工具

[复制链接]
发表于 2022-12-19 16:38:48 | 显示全部楼层 |阅读模式
Docker容器中安装vim工具


一、进入容器
进入docker容器修改文件提示bash: vim: command not found,于是需要在docker中安装相关的工具。
于是执行安装工具命令

  1. #查询容器
  2. docker ps

  3. #其中96656852148f为容器编号
  4. docker exec -it 96656852148f /bin/bash
复制代码





但是提示 List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied),看来是权限不足。

  1. docker exec -it -u 0 96656852148f /bin/bash

  2. 或者

  3. docker exec -itu root 96656852148f /bin/bash
复制代码


二、更新源
向/etc/apt/sources.list文件中,写入源地址


  1. echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >/etc/apt/sources.list
  2. echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >>/etc/apt/sources.list
  3. echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >>/etc/apt/sources.list
  4. echo  "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >>/etc/apt/sources.list
复制代码


更新源

  1. apt-get update
复制代码



三、安装vim工具
安装vim等工具


  1. apt-get install vim
复制代码




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册成为修仙之旅的少年~

x
游客
回复
*滑块验证:

DA论坛飞机票来了~
快速回复 返回顶部 返回列表