docker容器无法执行vim如何解决

本篇文章和大家了解一下docker容器无法执行vim如何解决。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

目录
  • docker容器无法执行vim【已解决】

  • docker容器中执行vim失败

  • 安装文件

    • 没更换之前,速度非常的慢

    • 【失败】这里我更换了163的但是报错

    • 【失败】这里我更换了阿里的第一种报错

    • 【成功】::::这里我更换了阿里的第二种成功

  • 完整步骤

    • 1:备份配置

    • 2:修改配置

    • 3:检查配置

    • 4:执行:apt-get update

    • 5:执行:apt-get install -y vim

    • 6:验证

  • 参考资料:

    docker容器无法执行vim【已解决】

    解决问题直接看完整步骤目录

    docker容器中执行vim失败

    bash: ll: command not found
    bash: vim: command not found
    bash: vi: command not found
    安装vim依旧报错

    docker容器无法执行vim如何解决

    我的版本 cat /etc/debian_version
    11.2

    安装文件

    # 正常步骤,但是第一步下载非常慢,需要更换一下地址
    1:apt-get update
    2: apt-get install -y vim

    没更换之前,速度非常的慢

    docker容器无法执行vim如何解决

    【失败】这里我更换了163的但是报错

    Ign:1 http://mirrors.163.com/debian jessie InRelease
    Ign:2 http://mirrors.163.com/debian jessie-proposed-updates InRelease
    Ign:3 http://mirrors.163.com/debian jessie-updates InRelease
    Ign:4 http://mirrors.163.com/debian jessie-backports InRelease
    Ign:5 http://mirrors.163.com/debian-security jessie/updates InRelease
    Get:6 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [116 kB]
    Err:7 http://mirrors.163.com/debian jessie Release
    404 Not Found [IP: 101.71.33.11 80]
    Err:8 http://mirrors.163.com/debian jessie-proposed-updates Release
    404 Not Found [IP: 101.71.33.11 80]
    Err:9 http://mirrors.163.com/debian jessie-updates Release
    404 Not Found [IP: 101.71.33.11 80]
    Err:10 http://mirrors.163.com/debian jessie-backports Release
    404 Not Found [IP: 101.71.33.11 80]
    Err:11 http://mirrors.163.com/debian-security jessie/updates Release
    404 Not Found [IP: 101.71.33.11 80]
    Reading package lists... Done
    E: The repository 'http://mirrors.163.com/debian jessie Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.163.com/debian jessie-proposed-updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.163.com/debian jessie-updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.163.com/debian jessie-backports Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.163.com/debian-security jessie/updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

    docker容器无法执行vim如何解决

    【失败】这里我更换了阿里的第一种报错

    root@a7e7ebb2ecad:/var/lib/apt/lists# echo -e "deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib \ndeb http://mirrors.aliyun.com/debian-security stretch/updates main \ndeb-src http://mirrors.aliyun.com/debian-security stretch/updates main \ndeb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \ndeb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \ndeb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list
    root@a7e7ebb2ecad:/var/lib/apt/lists#
    root@a7e7ebb2ecad:/var/lib/apt/lists# cat /etc/apt/sources.list
    deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
    deb http://mirrors.aliyun.com/debian-security stretch/updates main
    deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
    deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
    deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
    root@a7e7ebb2ecad:/var/lib/apt/lists# apt-get update
    Ign:1 http://mirrors.aliyun.com/debian stretch InRelease
    Ign:2 http://mirrors.aliyun.com/debian-security stretch/updates InRelease
    Ign:3 http://mirrors.aliyun.com/debian stretch-updates InRelease
    Ign:4 http://mirrors.aliyun.com/debian stretch-backports InRelease
    Get:5 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [116 kB]
    Err:6 http://mirrors.aliyun.com/debian stretch Release
    404 Not Found [IP: 60.28.226.53 80]
    Err:7 http://mirrors.aliyun.com/debian-security stretch/updates Release
    404 Not Found [IP: 60.28.226.53 80]
    Err:8 http://mirrors.aliyun.com/debian stretch-updates Release
    404 Not Found [IP: 60.28.226.53 80]
    Err:9 http://mirrors.aliyun.com/debian stretch-backports Release
    404 Not Found [IP: 60.28.226.53 80]
    Reading package lists... Done
    E: The repository 'http://mirrors.aliyun.com/debian stretch Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.aliyun.com/debian-security stretch/updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.aliyun.com/debian stretch-updates Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: The repository 'http://mirrors.aliyun.com/debian stretch-backports Release' does not have a Release file.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

    docker容器无法执行vim如何解决

    【成功】::::这里我更换了阿里的第二种成功

    #Aliyun Apt Source 阿里云镜像源
    echo "deb http://mirrors.aliyun.com/debian/ bullseye main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-updates main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-backports main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-proposed-updates main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-proposed-updates main contrib" >> /etc/apt/sources.list
    root@a7e7ebb2ecad:/# apt-get update
    Get:1 http://mirrors.aliyun.com/debian bullseye InRelease [116 kB]
    Get:2 http://mirrors.aliyun.com/debian bullseye-updates InRelease [44.1 kB]           
    Get:3 http://mirrors.aliyun.com/debian bullseye-backports InRelease [49.0 kB]
    Get:4 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease [116 kB]
    Get:5 http://mirrors.aliyun.com/debian bullseye-proposed-updates InRelease [54.0 kB]
    Get:6 http://mirrors.aliyun.com/debian bullseye/contrib Sources [43.2 kB]
    Get:7 http://mirrors.aliyun.com/debian bullseye/main Sources [8,637 kB]        
    Get:8 http://mirrors.aliyun.com/debian bullseye/main amd64 Packages [8,183 kB]
    Get:9 http://mirrors.aliyun.com/debian bullseye/contrib amd64 Packages [50.6 kB]
    Get:10 http://mirrors.aliyun.com/debian bullseye-updates/main Sources [4,812 B]
    Get:11 http://mirrors.aliyun.com/debian bullseye-updates/main amd64 Packages [14.6 kB]
    Get:12 http://mirrors.aliyun.com/debian bullseye-backports/main Sources [429 kB]
    Get:13 http://mirrors.aliyun.com/debian bullseye-backports/contrib Sources [4,280 B]
    Get:14 http://mirrors.aliyun.com/debian bullseye-backports/main amd64 Packages [419 kB]
    Get:15 http://mirrors.aliyun.com/debian bullseye-backports/contrib amd64 Packages [5,692 B]
    Get:16 http://mirrors.aliyun.com/debian bullseye-proposed-updates/main Sources [8,072 B]
    Get:17 http://mirrors.aliyun.com/debian bullseye-proposed-updates/main amd64 Packages [29.3 kB]
    Fetched 18.2 MB in 6s (2,999 kB/s)                                                                                                                                                              
    Reading package lists... Done

    docker容器无法执行vim如何解决

    完整步骤

    1:备份配置

    cp /etc/apt/sources.list /etc/apt/sources.list.bak

    2:修改配置

    # Aliyun Apt Source 阿里云镜像源
    echo "deb http://mirrors.aliyun.com/debian/ bullseye main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-updates main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-backports main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.aliyun.com/debian/ bullseye-proposed-updates main contrib" >> /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-proposed-updates main contrib" >> /etc/apt/sources.list

    3:检查配置

    cat /etc/apt/sources.list

    docker容器无法执行vim如何解决

    4:执行:apt-get update

    docker容器无法执行vim如何解决

    5:执行:apt-get install -y vim

    6:验证

    vim /etc/hosts

    docker容器无法执行vim如何解决

    以上就是docker容器无法执行vim如何解决的简略介绍,当然详细使用上面的不同还得要大家自己使用过才领会。如果想了解更多,欢迎关注编程之家行业资讯频道哦!

    版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

    相关推荐


    最近一直在开发Apworks框架的案例代码,同时也在一起修复Apworks框架中的Bug和一些设计上的不足。遇到的一个普遍问题是,代码的调试过程需要依赖很多外部系统,比如MongoDB、PostgreSQL、RabbitMQ等。当然可以在本机逐一安装这些服务,然后对服务进行配置,使其满足自己开发调试
    最近每天都在空闲时间努力编写Apworks框架的案例代码WeText。在文本发布和处理微服务中,我打算使用微软的SQL Server for Linux来做演示,于是也就在自己的docker-compose中加入了MS SQL Server的服务。其实在Docker中运行SQL Server是非常容
    在《Kubernetes中分布式存储Rook-Ceph部署快速演练》文章中,我快速介绍了Kubernetes中分布式存储Rook-Ceph的部署过程,这里介绍如何在部署于Kubernetes的ASP.NET Core MVC的应用程序中使用Rook-Ceph所创建的存储对象。 构建ASP.NET C
    最近在项目中有涉及到Kubernetes的分布式存储部分的内容,也抽空多了解了一些。项目主要基于Rook-Ceph运行,考虑到Rook-Ceph部署也不那么简单,官方文档的步骤起点也不算低,因此,在整合官方文档的某些步骤的基础上,写篇文章简单总结一下。 Rook-Ceph是Kubernetes中分布
    CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.netcore(二) 之 Dockerfile CentOS下Docker与.netcore(三)之 三剑客之一Docker-Compose CentOS下Docker与.netcore(四)之 三剑客之一D
    CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.netcore(二) 之 Dockerfile CentOS下Docker与.netcore(三)之 三剑客之一Docker-Compose CentOS下Docker与.netcore(四)之 三剑客之一D
    构建镜像最具挑战性的一点是使镜像大小尽可能的小。Dockerfile中的每条指令都为图像添加了一个图层,您需要记住在移动到下一层之前清理任何不需要的工件。对于多阶段构建,您可以在Dockerfile中使用多个FROM语句。每个FROM指令可以使用不同的基础,并且每个指令都开始一个新的构建。您可以选择
    本文介绍compose配置文件参数的使用,熟练编写compose文件 [root@docker lnmp]# cat lnmp.yaml version: '3' services: nginx: build: /root/docker_demo/nginx/ ports: - &q
    环境 docker-machine主机:192.168.1.9 docker主机:192.168.1.10 步骤: 安装docker-machine 创建ssh密钥对,实现两主机无密登录 创建docker主机,命名host1 变更docker环境变量 运行容器查看两端是否同步 镜像容器同步测试成功
    CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.netcore(二) 之 Dockerfile CentOS下Docker与.netcore(三)之 三剑客之一Docker-Compose CentOS下Docker与.netcore(四)之 三剑客之一D
    https://blog.csdn.net/wanglei_storage/article/details/77508620 实践中会发现,生产环境中使用单个 Docker 节点是远远不够的,搭建 Docker 集群势在必行。然而,面对 Kubernetes, Mesos 以及 Swarm 等众多容
    1.引言 紧接上篇.NET Core容器化@Docker,这一节我们先来介绍如何使用Nginx来完成.NET Core应用的反向代理,然后再介绍多容器应用的部署问题。 2. Why Need Nginx .NET Core中默认的Web Server为Kestrel。 Kestrel is grea
    docker rm `docker ps -a | grep Exited | awk '{print $1}'` 删除异常停止的docker容器 docker rmi -f `docker images | grep '<none>' | awk &#3
    什么是Docker Compose 在微服务盛行的今天,我们通常是这么定义Compose的:对容器的统一启动和关闭的编排工具。 但是我以前还是有个疑惑,谁会用Compose在一台服务器上部署多个服务呢?干脆直接用单体服务就行了!直到我遇到了以下的一个需求,让我明白了在一台服务器上不得不用多个服务的时
    CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.netcore(二) 之 Dockerfile CentOS下Docker与.netcore(三)之 三剑客之一Docker-Compose CentOS下Docker与.netcore(四)之 三剑客之一D
    很多时候,我们在本地开发过程中程序运行很正常,但是发布到线上之后由于环境的原因,可能会有一些异常。通常我们会通过日志来分析问题,除了日志还有一种常用的调试手段就是:附加进程。 VS中的附加进程非常强大,目前提供了9种常用的附加方式。 在当前.Net Core支持跨平台的大背景下,其中Linux环境和
    https://www.cnblogs.com/bigberg/p/8867326.html 一、简介 Docker有个编排工具docker-compose,可以将组成某个应该的多个docker容器编排在一起,同时管理。同样在Swarm集群中,可以使用docker stack 将一组相关联的服务进行
    .Net6中想实现对某个网址截屏,可通过Selenium模拟访问网址并实现截图。 实现 安装Nuget包 <PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" /&g
    原文 https://www.cnblogs.com/gispathfinder/p/5871043.html 我们在使用docker run创建Docker容器时,可以用--net选项指定容器的网络模式,Docker有以下4种网络模式: host模式,使用--net=host指定。 co