存储库类型和 PPA 之间的区别

存储库类型和 PPA 之间的区别

当我想安装 wine 时,我会得到按以下方式添加存储库的说明。

sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/

要安装 PlayOnLinux,我得到了类似的说明,但我需要在 URL 周围添加引号。为什么会有差异?这有关系吗deb""

sudo add-apt-repository "deb http://deb.playonlinux.com/ bionic main"

为什么 PPA 根本不需要任何 URL?是吗?给定URL 是https://launchpad.net/

sudo add-apt-repository ppa:peek-developers/stable

答案1

man add-apt-repository

SYNOPSIS
       add-apt-repository [OPTIONS] REPOSITORY

...

REPOSITORY STRING
       REPOSITORY can be either a line that can be added directly to
       sources.list(5), in the form ppa:<user>/<ppa-name> for adding
       Personal  Package  Archives, or a distribution component to
       enable.

       In the first form, REPOSITORY will just be appended to
       /etc/apt/sources.list.

对于"deb http://deb.playonlinux.com/ bionic main",它将被逐字附加。这包括拥有 这样的发行版bionic,即使您没有运行 Ubuntu Bionic 18.04。(请注意,playonlinux多元宇宙仓库中也有提供。

对于https://dl.winehq.org/wine-builds/ubuntu/,add-apt-repository 将推断缺失的部分:

  • 类型 (deb
  • 分布(、、、xenial等)artfulbionic
  • 成分 (main

       In  the  second  form,  ppa:<user>/<ppa-name> will be expanded
       to the full deb line of the PPA and added into a new file in the
       /etc/apt/sources.list.d/ directory.  The GPG public key of the
       newly added PPA will also be downloaded and added to apt's
       keyring.

这适用于ppa:peek-developers/stable。是的,主机被认为是 Launchpad。

       In the third form, the given distribution component will be
       enabled for all sources.

例如universemultiverse

有关 sources.list 格式的详细信息来自man sources.list

相关内容