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 找到会发现报错的网址就在此处并取消勾选

相关推荐
hgdlip16 分钟前
电脑的ip地址会自动变怎么办?原因解析和解决方法
运维·网络·tcp/ip·电脑
ZZH1120KQ19 分钟前
Linux账号和权限管理
linux·运维
@Liu_GuoXing25 分钟前
Registry和docker有什么关系?
运维·docker·容器·registry
XMAIPC_Robot40 分钟前
基于 ZYNQ UltraScale+ OV5640的高速图像传输系统设计,支持国产替代
linux·数码相机·fpga开发·架构·边缘计算
水水沝淼㵘44 分钟前
嵌入式开发学习日志(linux系统编程--系统编程之 进程间通信IPC)Day32
linux·运维·学习
IT小饕餮1 小时前
linux登陆硬件检测脚本
linux·运维·服务器
Dxy12393102161 小时前
DrissionPage 性能优化实战指南:让网页自动化效率飞升
运维·爬虫·python·性能优化·自动化
碎梦归途3 小时前
Linux 软件安装方式全解(适用于 CentOS/RHEL 系统)
linux·运维·centos
啃火龙果的兔子3 小时前
CentOS 7.9 安装 宝塔面板
linux·运维·centos
DexterLien3 小时前
基于 Alpine 定制单功能用途(kiosk)电脑
linux·alpine·kiosk