所有 Ubuntu 更新下载服务器都只支持 HTTP 吗?

Tom*_*man 14 update-manager security https

在 Update Manager 的软件源中,存在用于选择下载服务器和协议的选项,如下所示。

是否仅通过 HTTP 下载所有更新?

如果不支持 HTTPS(或 SFTP),为什么存在该选项?相关问题here,虽然它只处理完整的 ISO 图像。

选择下载服务器截图

fos*_*dom 9

软件支持的协议

可能是,显示协议下拉列表的软件可以支持 https 镜像 - 有问题的下拉框接受以下有效协议

  • FTP
  • http
  • 文件
  • 同步
  • https

这在 software-properties-gtk 包源代码中有详细说明:

apt-get source software-properties-gtk
cd software-properties*/softwareproperties/gtk
Run Code Online (Sandbox Code Playgroud)

查看文件DialogMirror.py - 函数def is_valid_mirror

有一个但是...

但实际上,Ubuntu 支持的公共镜像仅限于http://, ftp://&rsync://

定义新镜像时,您可以定义的镜像是有限的:

本地镜像

因此,由于软件本身不限制协议,通过 HTTPS 下载的一种方法是定义和维护自己的本地存储库和镜像。像往常一样,我们有一个很好的问答,其中有几个适用的答案:

apt-mirror可能是你最好的选择。安装apt-mirror软件包并检查其手册页:

配置示例 mirror.list 配置支持许多选项...

   HTTPS with sending Basic HTTP authentication information (plaintext username and password) for all
   requests: (this was default behaviour of Wget 1.10.2 and prior and is needed for some servers with new
   version of Wget) set auth_no_challenge 1 deb https://user:pass@example.com:443/debian stable main contrib
   non-free

   HTTPS without checking certificate: set no_check_certificate 1 deb https://example.com:443/debian stable
   main contrib non-free
Run Code Online (Sandbox Code Playgroud)

如您所见,您可以定义本地 HTTPS 镜像 - 添加您的本地 HTTPS 镜像,它应该会出现在镜像列表中。