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

news2024/9/22 19:33:42

在这里插入图片描述

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

      • docker容器中执行vim失败
      • 安装文件
        • 没更换之前,速度非常的慢
        • 【失败】这里我更换了163的但是报错
        • 【失败】这里我更换了阿里的第一种报错
        • 【成功】::::这里我更换了阿里的第二种成功
      • 完整步骤
        • 1:备份配置
        • 2:修改配置
        • 3:检查配置
        • 4:执行:apt-get update
        • 5:执行:apt-get install -y vim
        • 6:验证
      • 参考:

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

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
2apt-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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/511054.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

struct模块进行数据打包

原理: 将一组简单数据进行打包,转换为bytes格式发送。或者将一组bytes格式数据,进行解析。 接口使用 Struct(fmt) 功能: 生成结构化对象 参数:fmt 定制的数据结构 st.pack(v1,v2,v3…) 功能: 将一组数据按照指定格式打包转换为by…

分子动力学基础知识

分子动力学基础知识 目前主要存在两种基本模型:其一为量子统计力学, 其二为经典统计力学。 量子统计力学 基于量子力学原理, 适用 于微观的, 小尺度, 短时 间的模拟,可以描述电子 的结构分布,原子间的成 键断键等化学性质。 经典纭计力学…

MySQL原理(七):内存管理和磁盘管理

前言 上一篇介绍了 MySQL 的日志,这一篇将介绍内存管理和磁盘管理相关的内容。 内存管理 MySQL 的数据都是存在磁盘中的,我们要更新一条记录的时候,得先要从磁盘读取该记录,然后在内存中修改这条记录。修改完这条记录后会缓存起…

15 KVM虚拟机配置-体系架构相关配置

文章目录 15 KVM虚拟机配置-体系架构相关配置15.1 概述15.2 元素介绍15.3 AArch64架构配置示例15.4 x86_64架构配置示例 15 KVM虚拟机配置-体系架构相关配置 15.1 概述 XML中还有一部分体系架构相关的配置,这部分配置包括主板,CPU,一些与体…

【2023/05/10】Mitchel Resnick

Hello!大家好,我是霜淮子,2023倒计时第5天。 Share Her wistful face haunts my dreams like the rain at night. 译文: 她的热切的脸,如夜雨似的,搅扰着我的梦魂。 Once we dreamt that we were stra…

论文解读:DELPHI:用于蛋白质相互作用位点预测的精确深度集成模型

期刊: Briefings in Bioinformatics 出版日期 2022-11-22 websever:https://iasri-sg.icar.gov.in/pldbpred/ 网址: PlDBPred: a novel computational model for discovery of DNA binding proteins in plants | Briefings in Bioinformatics | Oxfo…

递归到动态规划- X-空间压缩技巧

空间压缩技巧的示例代码代码, LeetCode第64题 验证链接:力扣 package dataStructure.recurrence.practice;/*** https://leetcode.cn/problems/minimum-path-sum/* Leecode第64题* 给定一个包含非负整数的 m x n 网格 grid ,请找出一条从左…

C++好难(6):模板初阶

【本节目标】 1. 泛型编程2. 函数模板3. 类模板 目录 【本节目标】 1.泛型编程 2.函数模板 概念: 格式: 原理: 实例化: 1.隐式实例化: 2.显式实例化 原则一: 原则二: 原则三&#…

数组存储与指针学习笔记(三)指针与数组

嵌入式C语言学习进阶系列文章 GUN C编译器拓展语法学习笔记(一)GNU C特殊语法部分详解 GUN C编译器拓展语法学习笔记(二)属性声明 GUN C编译器拓展语法学习笔记(三)内联函数、内建函数与可变参数宏 数组存储与指针学习笔记(一)数…

OpenCv更改颜色空间以及图像阈值

本文主要讲解以下几个方面: 如何将图片从一个颜色空间转换到另一个,例如 BGR 到 Gray,BGR 到 HSV 等。简单阈值法另外,我们会创建一个从图片中提取彩色对象的应用。 1.改变颜色空间 cv.cvtColor(img, flag) 参数flag表示颜色空间转换的方…

Hive语言2(大数据的核心:窗口函数)

1、Common Table Expressions(CTE)> 重点 公用表达式(CTE)是一个临时结果集,该结果集是从WITH子句中指定的简单查询派生而来的,该查询紧接在SELECT或INSERT关键字之前。 2.inner join(内连接)、left joi…

网页源码加密JavaScript程序,有效压缩和加密JS、Html、Css页面数据

我们知道,基于Des或Aes对称加密时,当明文和密码相同,则密文相同。而我们此次发布是WJLSymmetricEncryption4.js(点击链接跳转到下载页面)加密程序,当明文和密码相同,每次加密后的密文不相同&…

20230510vmlinux编译过程

1.进入linux内核源码目录下&#xff0c;打开Makefile文件&#xff0c;搜索vmlinux cmd_link-vmlinux \ $(CONFIG_SHELL) $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)"; …

第10 CURD操作与RedisCache缓存的强制清理的实现

using System.Net; using Microsoft.Extensions.Caching.Distributed; using Core.Caching; using Core.Configuration; using StackExchange.Redis; namespace Services.Caching { /// <summary> /// 【Redis分布式缓存数据库软件管理器--类】 /// <remarks>…

索引 ---MySQL的总结(五)

索引 在mysql数据库之中&#xff0c;如果数据量过大&#xff0c;直接进行遍历会需要使用许多时间。这里使用空间换时间解决这一个问题。 目前就是从解决问题的这一个角度出发&#xff0c;需要增加搜索的速度&#xff0c;一定是要选择好用的数据结构进行搜索&#xff08;遍历的…

第十五届吉林省赛个人题解【中档题(不过可能对你来说是简单题)】(H、G、C)

文章目录 H. Visit the Park(STL)G. Matrix Repair(思维题)C.Random Number Generator(BSGS算法) H. Visit the Park(STL) 题意&#xff1a;给你一个无向图&#xff0c;每条边上都有一个数码&#xff0c;然后给你一个路径&#xff0c;每次你必须从Ai走到Ai1&#xff08;直接走…

【EHub_tx1_tx2_A200】Ubuntu18.04 + ROS_ Melodic + 锐驰LakiBeam 1L单线激光 雷达评测

大家好&#xff0c;我是虎哥&#xff0c;最近这段时间&#xff0c;又手欠入手了锐驰LakiBeam 1L激光雷达&#xff0c;实在是性价比太优秀&#xff0c;话说&#xff0c;最近激光雷达圈确实有点卷。锐驰官网的资料已经很丰富&#xff0c;我这里总结一下自己的简单测试经验&#x…

挑战14天学完Python---

抛弃了数学思维,引入了计算思维,计算思维是抽象和自动化相结合的结果 抽象:抽象问题的形式化逻辑 自动化:将抽象的结果通过程序自动实现 0.1在计算机内部转二进制 0.1转二进制 二进制的0.1与二进制0.2计算 结果再转十进制 在众多编程语言中 ,只有Python语言提供了复数类型.空间…

OpenCL编程指南-1.2OpenCL基本概念

OpenCL概念基础 面向异构平台的应用都必须完成以下步骤&#xff1a; 1&#xff09;发现构成异构系统的组件。 2&#xff09;探查这些组件的特征&#xff0c;使软件能够适应不同硬件单元的特定特性。 3&#xff09;创建将在平台上运行的指令块&#xff08;内核)。 4&#xff09…

紧跟 AI 步伐, Gitee 已支持 AI 模型托管

AI 时代已经来了&#xff01; 现在&#xff0c;越来越多的企业和个人开始使用 AI 技术来解决各种问题。想要了解 AI&#xff0c;那么就一定要了解 AI 模型&#xff0c;作为 AI 的核心技术之一&#xff0c;AI 模型为各种进阶的人工智能应用奠定了基础&#xff0c;从 ChatGPT 、…