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

相关推荐
程序员zgh6 小时前
Linux 系统调用
linux·运维·服务器·c语言·c++·系统安全
Stuomasi_xiaoxin6 小时前
ROS2介绍,及ubuntu22.04 安装ROS 2部署使用!
linux·人工智能·深度学习·ubuntu
带土16 小时前
2. Linux下FFmpeg C++音视频解码+推流开发
linux·c++·ffmpeg
cly17 小时前
Ansible自动化(十二):Jinja2过滤器
运维·自动化·ansible
P-ShineBeam7 小时前
八卡A100服务器坏卡引发 CUDA initialization: cudaGetDeviceCount()异常
运维·服务器·人工智能·语言模型
zhanglb127 小时前
Linux -kylin麒麟系统安装openSSH
linux·apache kylin
zhanglb127 小时前
Linux-麒麟系统安装内网穿透工具
linux·apache kylin
飞凌嵌入式7 小时前
解析一下面向教育领域的RV1126B\RK3506B\RK3576开发板
linux·人工智能
Xの哲學7 小时前
Linux io_uring 深度剖析: 重新定义高性能I/O的架构革命
linux·服务器·网络·算法·边缘计算
萤丰信息7 小时前
开启园区“生命体”时代——智慧园区系统,定义未来的办公与生活
java·大数据·运维·数据库·人工智能·生活·智慧园区