当前位置: 首页 > news >正文

Debian12换镜像源

0 背景

用docker运行了一个node容器,发现连vim也没有,所以打算安一个vim

1 查看操作系统

find / -name '*release*' #查看release信息

在这里插入图片描述
在这里插入图片描述

2 更换镜像源

2.1 从网上找个国内镜像源

确定好操作系统版本后,从网上搜一下对应的数据源。这里提供一个清华的源

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free

2.2 写入配置文件

切换目录到/etc/apt下
因为没有vim,不能直接复制粘贴,所以可以用重定向写入source.list

echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free' > sources.list

2.3 更新

apt-get update

注:这样镜像源就换好了,如果你发现还是有国外的源在更新,可以把原来的文件名改掉(sources.list.d文件夹下的文件随便加个后缀就行)

3 后记

如果你安装vim发现报错,vim-common版本有问题之类的报错,可以参考这个文章

http://www.lryc.cn/news/223643.html

相关文章:

  • deeplog中输出某个 event 的概率
  • 流媒体中relay和forword的区别
  • git创建本地分支并提交到远程
  • Selenium定位元素的方法css和xpath的区别
  • 【目标检测】SSD损失函数详解
  • C【整数正序分解】
  • 基于springboot实现高校党务平台管理系统【项目源码】计算机毕业设计
  • Day24力扣打卡
  • 5G-A 商用加速,赋能工业互联网
  • 代码随想录day2
  • UML/SysML建模工具更新(2023.10)(1)StarUML、Software Ideas Modeler
  • kubectl 资源管理命令-陈述式
  • 【紫光同创国产FPGA教程】——【PGL22G第九章】HDMI环路实验例程
  • IDEA Plugin插件开发相关踩坑
  • 汽车标定技术(八)--MPC57xx是如何支持标定的页切换
  • Ubuntu中增加交换内存
  • 一文带您了解云渲染
  • 分享4个MSVCP100.dll丢失的解决方法
  • 国际腾讯云服务器流量收费准分析!!
  • Redis系列-四种部署方式-单机部署+主从模式+哨兵模式【7】
  • Webpack 的作用和工作原理是什么?
  • ros1 实现Server端自定义四 Topic模式控制海龟运动
  • IntelliJ IDEA 2023.2.1 (Ultimate Edition) 版本 Git 如何找回被 Drop Commit 的提交记录
  • C# 压缩PDF文件
  • JS点击图片指定对象变色两种方法
  • 什么是浏览器指纹?指纹浏览器如何避免浏览器指纹的追踪识别?
  • uni-app 、Spring Boot 、ant Design 打造的一款跨平台包含小说(仿真翻页、段落听书)、短视频、壁纸等功能含完备后台管理的移动应用
  • STM32-EXTI中断
  • 2023云栖大会,Salesforce终敲开中国CRM市场
  • 工业镜头接口类型