PeaceSheep's blog PeaceSheep's blog
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)

PeaceSheep

以最简洁、易懂的话解决问题
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)
  • 01 说明
  • 环境安装与配置

    • ubuntu换源
      • centos安装配置docker
      • k8s介绍及安装教程
      • github actions自动部署前端项目
      • 服务器创建git仓库,部署自己的博客
      • 使用python批量管理linux设备
      • 关于如何使用机房电脑批量烧录U盘的奇思妙想
      • 自建Zerotier节点
      • ubuntu安装g++
      • conda从古老版本升级
      • openkylin国产麒麟操作系统安装zerotier
      • nodejs、yarn安装
    • 常用命令与配置文件

    • 常用代码

    • 常用操作
    • 环境安装与配置
    PeaceSheep
    2022-03-14
    目录

    ubuntu换源转载

    # 0. 一键复制

    sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
    echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse \
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse \
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse \
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse" | sudo tee /etc/apt/sources.list
    sudo apt-get update
    
    
    1
    2
    3
    4
    5
    6
    7

    # 1.备份原来的源,将以前的源备份一下,以防以后可以用的。

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

    # 2.打开/etc/apt/sources.list文件,在前面添加如下条目,并保存。

    sudo vim /etc/apt/sources.list( 可将vim更换为自己熟悉的编辑器)

    # 3.换源(任选其一)

    • 添加阿里源
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    • 添加清华源
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    # 4.更新

    1. 更新源

    sudo apt-get update

    1. 如出现依赖问题,解决方式如下:

    sudo apt-get -f install

    1. 更新软件:

    sudo apt-get upgrade

    原文链接

    https://zhuanlan.zhihu.com/p/142014944 (opens new window)

    编辑 (opens new window)
    #ubuntu#换源
    上次更新: 2025/05/28, 16:40:57
    01 说明
    centos安装配置docker

    ← 01 说明 centos安装配置docker→

    最近更新
    01
    愚蠢错误收集
    05-29
    02
    ubuntu安装g++显示已有但是输入g++又找不到命令
    04-15
    03
    使用cloudflare-r2搭建webdav
    04-08
    更多文章>
    Theme by Vdoing | Copyright © 2022-2025 PeaceSheep
    冀ICP备2022004632号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式