iis服务器助手广告广告
返回顶部
首页 > 资讯 > 服务器 >docker容器无法执行vim的解决方案
  • 635
分享到

docker容器无法执行vim的解决方案

docker容器无法执行vimdocker无法执行vimdocker vim 2023-05-20 09:05:05 635人浏览 八月长安
摘要

目录Docker容器无法执行vim【已解决】docker容器中执行vim失败安装文件没更换之前,速度非常的慢【失败】这里我更换了163的但是报错【失败】这里我更换了阿里的第一种报错【

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

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

docker容器中执行vim失败

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

我的版本 cat /etc/debian_version
11.2

安装文件

# 正常步骤,但是第一步下载非常慢,需要更换一下地址
1:apt-get update
2: apt-get install -y 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.

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

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.

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

#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

完整步骤

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

4:执行:apt-get update

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

6:验证

vim /etc/hosts

参考资料:

https://blog.csdn.net/yimaoya/article/details/125345414
https://blog.csdn.net/peng2hui1314/article/details/113247648

到此这篇关于docker容器无法执行vim的文章就介绍到这了,更多相关docker容器无法执行vim内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!

--结束END--

本文标题: docker容器无法执行vim的解决方案

本文链接: https://www.lsjlt.com/news/214273.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • docker容器无法执行vim的解决方案
    目录docker容器无法执行vim【已解决】docker容器中执行vim失败安装文件没更换之前,速度非常的慢【失败】这里我更换了163的但是报错【失败】这里我更换了阿里的第一种报错【...
    99+
    2023-05-20
    docker容器无法执行vim docker无法执行vim docker vim
  • docker容器无法执行vim如何解决
    本篇文章和大家了解一下docker容器无法执行vim如何解决。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。目录docker容器无法执行vim【已解决】docker容器中执行vim失败安装文件没更换之前,速度非常的慢【失败...
    99+
    2023-07-06
  • Docker容器无法停止删除的解决方案
    查找运行的容器id docker ps 查找上面容器的物理位置 cd /var/lib/docker/container ls -a #此处会显示所有容器的id,找出上面那...
    99+
    2022-11-11
  • docker容器中无法获取宿主机hostname的解决方案
    在nodejs环境中测试通过,其它语言同理,只需要使用获取环境变量的方法即可。 思路: docker容器和宿主机环境是隔离的,但是可以在启动docker容器时将宿主机的主机名以环境变...
    99+
    2022-11-11
  • Docker 无法停止或删除容器服务问题的解决方案
    前言 今天有开发同学给我反馈说有一个容器服务无法 stop、rm(docker rm -f)和 kill 等操作,也就是说这个容器服务无法终止~ 操作步骤 (1)执行删除命令无法删除...
    99+
    2022-11-12
  • python无法识别vim中文代码的解决方案
    问题描述,如图所示: 首先第一句字符sss没有打印出来,直接显示print中文问题;所以可以判断问题不是由python造成,而是由vim字符保存的编码规则导致的,出现的无法识别问题...
    99+
    2022-11-11
  • docker 无法释放端口的解决方案
    今天遇到一个非常奇葩的情况就是当更新完docker镜像后,运行docker-compose up -d 出现了Bind for 0.0.0.0:xxxx failed: port i...
    99+
    2022-11-11
  • 解决docker容器无法访问的问题
    服务器上的docker容器都无法访问了,而且裸机部署的应用则没有任务问题。 docker容器重启多次均无法访问!!! docker服务重启也无济于事!!! 服务器网卡重启也不行!!! 网上搜了一堆方法...
    99+
    2023-09-14
    docker 服务器 运维
  • mybatis有时update语句执行无效的解决方案
    目录项目里mybatis有时update语句执行无效解决办法执行update语句后,数据没有被更新,也没有报错问题描述详细情况解决办法项目里mybatis有时update语...
    99+
    2022-11-12
  • Docker中Mysql容器无法停止无法删除如何解决
    这篇文章主要介绍“Docker中Mysql容器无法停止无法删除如何解决”,在日常操作中,相信很多人在Docker中Mysql容器无法停止无法删除如何解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Docke...
    99+
    2023-07-05
  • 解决Docker容器下不能使用vim命令的问题
    在使用docker容器时,有时候里边没有安装vim,敲vim命令时提示说:vim: command not found,如图所示: 这时候就需要安装vim。 可是当你敲apt-ge...
    99+
    2022-11-13
  • docker容器中文乱码的解决方法
    目录概述环境具体操作如下1.查看系统支持和默认的字符集,更新yum2.下载中文包和对应的依赖包3.添加UTF-8和GBK和GB2312字符集4.修改系统字符集5.退出容器重启服务器6...
    99+
    2023-05-20
    docker中文乱码 docker容器中文乱码 docker容器数据传输中文乱码
  • Docker容器导致磁盘空间不足无法访问的解决方法
    目录问题:1.进入运行的容器目录2.查看容器的配置信息3.删除日志文件4.正常进入容器问题: 客户反馈说系统操作,出现问题,查询数据报错,我第一想到的是Redis是不是挂了导致一些存...
    99+
    2022-11-13
  • docker创建容器后无法启动怎么解决
    如果在创建 Docker 容器后无法启动,可以尝试以下几个解决方法: 查看容器状态:运行 `docker ps -a` 命令,查...
    99+
    2023-10-26
    docker
  • springboot 拦截器执行两次的解决方案
    springboot拦截器执行两次 原因是: org.springframework.boot.autoconfigure.web.servlet.error.BasicError...
    99+
    2022-11-12
  • Docker运行Nacos容器自动退出问题的解决方法
    Dokcer运行Nacos容器自动退出问题 参考博文 学生党,租的云服务器,2核2G。使用Docker运行Nacos容器的时候发现总是自动退出。Nacos日志里面没有明显的报错信息。...
    99+
    2022-11-13
  • SpringMVC AOP注解无效,切面不执行的解决方法
    本篇内容主要讲解“SpringMVC AOP注解无效,切面不执行的解决方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“SpringMVC AOP注解无效,切面不执行的解决方法”吧!AOP注解无...
    99+
    2023-06-20
  • MySQL中count(*)执行慢的解决方案
    目录一、 count(*) 的实现方式1、实现方式比较2、为什么InnoDB不像MyISAM一样,也把数字存起来3、小结二、计数方法1、用缓存系统保存计数2、在数据库保存计数三、不同...
    99+
    2022-11-13
  • Docker容器不识别宋体等字体的解决方案
    问题背景: 在使用docker部署项目的时候,由于项目中调用打印控件默认使用的是系统字体,在windows上部署没有问题,但是在docker容器中运行的时候,由于docker中没有宋...
    99+
    2022-11-11
  • Docker容器跨主机通信overlay网络的解决方案
    目录一、Docker主机间容器通信的解决方案二、Docker Overlay Network三、使用键值存储搭建Docker主机集群4.1 系统环境4.2 安装Consul4.3 节...
    99+
    2022-11-13
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作