码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Debian12换镜像源


    0 背景

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

    1 查看操作系统

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

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

    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-free
     
    deb 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-free
     
    deb 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-free
     
    deb 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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    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-free
    
    deb 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-free
    
    deb 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-free
    
    deb 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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    2.3 更新

    apt-get update
    
    • 1

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

    3 后记

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

  • 相关阅读:
    阴影text-shadow和box-shadow详解
    UE5 c++将自定义UserWdiget添加到对应菜单栏
    【学生个人网页设计作品】使用HMTL制作一个超好看的保护海豚动物网页
    全球名校AI课程库(4)| Stanford斯坦福 · 机器学习课程『Machine Learning』
    Oracle一个诡异的临时表空间不足的问题
    持续进化,快速转录,Faster-Whisper对视频进行双语字幕转录实践(Python3.10)
    算法分析与设计课后练习21
    C# 同步与异步方法
    Navicat 携手华为云 GaussDB,联合打造便捷高效的数据库开发和建模工具方案
    Java Lambda 表达式
  • 原文地址:https://blog.csdn.net/zyw61483/article/details/133644620
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号