[Ubuntu]apt源改为阿里源(基于Ubuntu 20.04/18.04)

我们需要根据我们自己Ubuntu系统版本来配置对应的apt源

一、常见LTS版本代号

  • Ubuntu 20.04代号为:focal
  • Ubuntu 19.04代号为:disco
  • Ubuntu 18.04代号为:bionic
  • Ubuntu 17.04代号为:zesty
  • Ubuntu 16.04代号为:xenial

二、查看linuxOS发行版本信息

查看命令:

lsb_release -a

ubuntu 20.04 ==> 发行版本代号为 focal

$ lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	    20.04
Codename:	    focal

ubuntu 18.04 ==> 发行版本代号为 bionic

$ lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

三、修改apt源

1. 修改sources.list文件

sudo gedit /etc/apt/sources.list

ubuntu 20.04

# 阿里源
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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports 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

ubuntu 18.04

# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

2.更新

$ sudo apt-get update
$ sudo apt-get upgrade

相关推荐

  1. [Ubuntu]apt阿里(基于Ubuntu 20.04/18.04)

    2024-03-10 17:00:07       42 阅读
  2. 修改Ubuntu的镜像阿里云镜像

    2024-03-10 17:00:07       34 阅读
  3. Ubuntu 修改镜像阿里云【详细步骤】

    2024-03-10 17:00:07       27 阅读
  4. ubuntu apt 更换阿里

    2024-03-10 17:00:07       56 阅读
  5. ubuntu arm64 阿里

    2024-03-10 17:00:07       36 阅读
  6. Ubuntu、CentOs更换阿里云的

    2024-03-10 17:00:07       23 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-10 17:00:07       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-10 17:00:07       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-10 17:00:07       87 阅读
  4. Python语言-面向对象

    2024-03-10 17:00:07       96 阅读

热门阅读

  1. linux系统elk组件kibana部署

    2024-03-10 17:00:07       49 阅读
  2. 【Node.js】-下载、安装和简单使用

    2024-03-10 17:00:07       39 阅读
  3. C. Messenger in MAC - 堆优化枚举

    2024-03-10 17:00:07       44 阅读
  4. vue-treeselect的下拉列表中的字体样式修改

    2024-03-10 17:00:07       42 阅读
  5. Spring-Cloud-Gateway Filter详细配置说明

    2024-03-10 17:00:07       47 阅读
  6. 53. 最大子数组和(力扣LeetCode)

    2024-03-10 17:00:07       50 阅读
  7. 阿里巴巴商家爬虫工具 1688采集软件使用教程

    2024-03-10 17:00:07       40 阅读
  8. hadoop 总结

    2024-03-10 17:00:07       45 阅读
  9. 解决:Glide 在回调中再次加载图片报错

    2024-03-10 17:00:07       47 阅读