欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > apt配置源

apt配置源

2024/10/25 14:34:28 来源:https://blog.csdn.net/qq_59468567/article/details/140429832  浏览:    关键词:apt配置源

源地址

地址
中科大USTC Open Source Software Mirror
华为云http://repo.huaweicloud.com/
阿里阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区
清华清华大学开源软件镜像站 | Tsinghua Open Source Mirror
网易欢迎访问网易开源镜像站
搜狐Index of /
中国官方清华大学开源软件镜像站 | Tsinghua Open Source Mirror
官方Index of /

apt-get 的服务器有 x86_64 和 aarch64 两种架构,一般称为 x86 和 arm。 使用命令arch可以查看当前系统架构。 x86 选择 ubuntu,arm 选择 ubuntu-ports

  • x84: http://mirrors.aliyun.com/ubuntu/
  • arm: http://mirrors.aliyun.com/ubuntu-ports/

源配置

一、图形界面配置(自动)

以ubuntu为例

第一步打开设置

第二步打开打开 Software & Updates

第三步红色框就是配置软件源的地方

点开下拉列表,打开other

第四步右边有个:Select Best Server,直接点击它会选择一个你当前网络最适合的源,需要耐心等待5-10分钟

但是有可能会出现这种情况

也可以选择手动添加上面的源地址

二、命令界面配置(手动)

首先打开相应镜像网站(以阿里云为例)

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区

选择相应的系统(我这里是ubuntu)

会给出配置方法

编辑配置文件

用你熟悉的编辑器打开:

/etc/apt/sources.list

替换默认的

http://archive.ubuntu.com/

http://mirrors.aliyun.com/

例如

用vim编辑配置文件:/etc/apt/sources.list

vi /etc/apt/sources.list

 

这里大概讲一下参数

源的类型配置项
二进制包deb
源码包deb-src

这两个参数后面的源域名可以重复,不影响,建议用两个参数都配置一遍

我把我的配置文件全放下面,可以全部选替换(vim编辑器如何操作,去搜一下就行)

配置文件的参数代表的意思,我也放下面(借一下别人的图)

/etc/apt/sources.list文件:

deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
最后更新源
sudo apt-get update

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com