Linux换源

前言

安装完Linux系统,尽量更换源以提高安装软件的速度。

步骤

  1. 备份原始源列表sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  2. 修改sources.list
    sudo vim /etc/apt/sources.list
  3. 将内容替换成对应的源

**PS:清华源地址:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/ **

(根据系统赋值对应的源)

4.更新并升级
sudo apt-get update && sudo apt-get upgrade

Q&A

问题1

遇到sudp apt-get update错误
liuxinyu20@ubuntu:~$ sudo apt-get update Hit:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease Hit:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease Hit:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease Hit:1 https://packages.microsoft.com/repos/code stable InRelease Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease Err:6 https://download.docker.com/linux/ubuntu focal InRelease Cannot initiate the connection to download.docker.com:443 (2a03:2880:f12c:183:face:b00c:0:25de). - connect (101: Network is unreachable) Could not connect to download.docker.com:443 (162.220.12.226). - connect (111: Connection refused) Reading package lists... Done W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/focal/InRelease Cannot initiate the connection to download.docker.com:443 (2a03:2880:f12c:183:face:b00c:0:25de). - connect (101: Network is unreachable) Could not connect to download.docker.com:443 (162.220.12.226). - connect (111: Connection refused) W: Some index files failed to download. They have been ignored, or old ones used instead.

解决方法:

1.进入/etc/apt/sources.list.d/ 目录 ,删除 docker.list 和 docker.list.save文件

复制代码
cd /etc/apt/sources.list.d/
sudo rm -f docker.list
sudo rm -f docker.list.save

2.依次找到 Software & Updates -> Other SoftWare 找到会发现报错的网址就在此处并取消勾选

相关推荐
Jinkxs20 分钟前
LoadBalancer- 主流负载均衡工具盘点:Nginx / Haproxy / Keepalived 基础介绍
运维·nginx·负载均衡
秋925 分钟前
MySQL 8.0.46 全平台安装与配置详解(Windows/Linux/macOS)
linux·windows·mysql
小康小小涵1 小时前
基于ESP32S3实现无人机RID模块底层源码编译
linux·开发语言·python
CQU_JIAKE1 小时前
4.28~4.30【Q】
linux·运维·服务器
左手厨刀右手茼蒿1 小时前
Linux 内核中的设备驱动开发:从字符设备到网络设备
linux·嵌入式·系统内核
先知后行。1 小时前
Linux 设备模型和platform平台
linux·运维·服务器
lzh200409191 小时前
深入理解进程:从PCB内核结构到写时拷贝的底层实战
linux·c++
Data_Journal1 小时前
如何使用cURL更改User Agent
大数据·服务器·前端·javascript·数据库
日取其半万世不竭2 小时前
Minecraft Java版社区服务器搭建教程(Linux,适合新手)
java·linux·服务器
时空自由民.2 小时前
蓝牙协议之GAP协议
linux·服务器·网络