首页 > 系统相关 >ubuntu换源

ubuntu换源

时间:2024-02-15 13:45:25浏览次数:40  
标签:mirrors universe 换源 https ubuntu deb main

换源

先将原始文件做备份:

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

打开文件:

sudo vim /etc/apt/sources.list

将源写入文件,这里根据自己的版本去选择对于的源,不知道的话先查询自己的版本

root@Ubuntu:~# cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"

ubuntu 22.04(jammy)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

ubuntu 20.04(focal)版本

deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

ubuntu 18.04(bionic)版本

deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

ubuntu 16.04 版本

deb https://mirrors.aliyun.com/ubuntu/ xenial main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main

deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe

标签:mirrors,universe,换源,https,ubuntu,deb,main
From: https://www.cnblogs.com/qianyuzz/p/18016190

相关文章

  • 【虚拟机新手起步03】3步完成ubuntu22.04安装。
    ubuntu下载安装详细过程一、ubuntu镜像下载二、打开VMware使用ubuntu镜像三、设置ubuntu虚拟机一.ubuntu镜像下载:https://cn.ubuntu.com/download二.打开VMware使用ubuntu镜像这块的话使用root会报错,使用一个别的用户名:启动ubuntu:三.设置ubuntu虚拟......
  • Ubuntu 中通过源码安装 Python3.x 环境
    最近在个人前后端分离项目时候,后端接口程序fastapi,在部署的时候,需要Pyhton3.8以上的环境,但ubuntu默认的是2.7于是想通过源码安装的方式进行环境搭建.下载官网下载二进制源码安装包:https://www.python.org/downloads/source/wegthttps://www.python.org/ftp/......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......
  • Ubuntu 设置合上笔记本盖子不休眠的方法
    Ubuntu设置合上笔记本盖子不休眠的方法编辑下列文件:sudogedit/etc/systemd/logind.conf​​#HandlePowerKey按下电源键后的行为,默认poweroff​​#HandleSleepKey按下挂起键后的行为,默认suspend​​#HandleHibernateKey按下休眠键后的行为,默认hibernate​​#HandleLidS......