【Ubuntu】利用阿里云apt源来更新apt源

打印 上一主题 下一主题

主题 835|帖子 835|积分 2505

1.前言 

我在京东云买了一个云服务器,但是我第一次利用apt的时候,发现碰到了下面这些情况 

后面听老师讲,还需要实行下面这个 

 但是我再次利用apt下载软件的时候,照旧出现了下面这个情况

后面问了老师才知道是apt源的问题!
2.利用阿里云的apt源来更新

起首我们需要知道我们的系统是哪个版本的
  1. cat /etc/os-release
复制代码
 
像我的就是ubuntu 22.04版本的
接下来用你熟悉的编辑器打开:
  1. /etc/apt/sources.list
复制代码
 
接下来我们需要做的就是
替换默认的
  1. http://archive.ubuntu.com/
复制代码

  1. https://mirrors.aliyun.com/
复制代码
阿里云的apt源官网:ubuntu镜像_ubuntu下载地址_ubuntu安装教程-阿里巴巴开源镜像站 (aliyun.com) 
 2.1. ubuntu 14.04 LTS (trusty) (EOL) 设置如下

  1. deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
  7. deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
  8. deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
  9. ## Not recommended
  10. # deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
  11. # deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
复制代码
 2.2. ubuntu 16.04 LTS (xenial) (EOL) 设置如下

  1. deb https://mirrors.aliyun.com/ubuntu/ xenial main
  2. deb-src https://mirrors.aliyun.com/ubuntu/ xenial main
  3. deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
  4. deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main
  5. deb https://mirrors.aliyun.com/ubuntu/ xenial universe
  6. deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
  7. deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  8. deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
  9. deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
  10. deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
  11. deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
  12. deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe
复制代码
2.3. ubuntu 18.04 LTS (bionic) 设置如下 

  1. deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  7. # deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  9. deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
2.4. ubuntu 20.04 LTS (focal) 设置如下

  1. deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  7. # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  9. deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
复制代码
2.5. ubuntu 22.04 LTS (jammy) 设置如下 

  1. deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
  7. # deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
  9. deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
复制代码
 2.6. ubuntu 23.04 (lunar) 设置如下

  1. deb https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ lunar main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ lunar-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ lunar-updates main restricted universe multiverse
  7. # deb https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ lunar-proposed main restricted universe multiverse
  9. deb https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ lunar-backports main restricted universe multiverse
复制代码
 2.7. ubuntu 24.04 (noble) 设置如下

  1. deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
  2. deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
  3. deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
  4. deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
  5. deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
  6. deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
  7. # deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
  8. # deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
  9. deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
  10. deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
复制代码
3.更换apt源 

由于我的是ubuntu 22.04,所以我就选ubuntu 22.04的,把/etc/apt/sources.list之前的apt源表明掉,把新的加进去。

生存退出之后,我们注意要实行下面这个命令啊
  1. sudo apt update
复制代码
 
 然后我们就可以利用apt下载软件啦

 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

tsx81429

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表