如何获取 Pop-OS 发行版附带的默认存储库?

如何获取 Pop-OS 发行版附带的默认存储库?

我已经删除了里面的文件/etc/apt/sources.list.d并且我的文件中没有任何内容/etc/apt/sources.list。我想恢复apt到安装发行版时的状态。回购协议等等。

哪些存储库是必不可少的以及如何将它们添加到我的sources.list文件和sources.list.d文件夹中?

我运行时出错sudo add-apt-repository "deb http://apt.pop-os.org/proprietary $(lsb_release -cs) main"

Repository: 'deb http://apt.pop-os.org/proprietary hirsute main'
Description:
Archive for codename: hirsute components: main
More info: http://apt.pop-os.org/proprietary
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Found existing deb entry in /etc/apt/sources.list.d/archive_uri-http_apt_pop-os_org_proprietary-hirsute.list
Adding deb entry to /etc/apt/sources.list.d/archive_uri-http_apt_pop-os_org_proprietary-hirsute.list
Found existing deb-src entry in /etc/apt/sources.list.d/archive_uri-http_apt_pop-os_org_proprietary-hirsute.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-http_apt_pop-os_org_proprietary-hirsute.list
Hit:1 http://apt.pop-os.org/proprietary hirsute InRelease
Ign:2 http://apt.pop-os.org/release hirsute InRelease
Hit:3 http://apt.pop-os.org/staging-proprietary hirsute InRelease
Ign:4 http://apt.pop-os.org/staging/master hirsute InRelease
Ign:5 http://apt.pop-os.org/ubuntu hirsute InRelease
Ign:6 http://apt.pop-os.org/ubuntu hirsute-security InRelease
Ign:7 http://apt.pop-os.org/ubuntu hirsute-updates InRelease
Ign:8 http://apt.pop-os.org/ubuntu hirsute-backports InRelease
Ign:9 http://apt.pop-os.org/ubuntu hirsute-proposed InRelease
Err:10 http://apt.pop-os.org/release hirsute Release
  404  Not Found [IP: 99.86.114.110 80]
Err:11 http://apt.pop-os.org/staging/master hirsute Release
  404  Not Found [IP: 99.86.114.110 80]
Err:12 http://apt.pop-os.org/ubuntu hirsute Release
  404  Not Found [IP: 99.86.114.110 80]
Err:13 http://apt.pop-os.org/ubuntu hirsute-security Release
  404  Not Found [IP: 99.86.114.110 80]
Err:14 http://apt.pop-os.org/ubuntu hirsute-updates Release
  404  Not Found [IP: 99.86.114.110 80]
Err:15 http://apt.pop-os.org/ubuntu hirsute-backports Release
  404  Not Found [IP: 99.86.114.110 80]
Err:16 http://apt.pop-os.org/ubuntu hirsute-proposed Release
  404  Not Found [IP: 99.86.114.110 80]
Reading package lists... Done
E: The repository 'http://apt.pop-os.org/release hirsute Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/staging/master hirsute Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/ubuntu hirsute Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/ubuntu hirsute-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/ubuntu hirsute-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/ubuntu hirsute-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://apt.pop-os.org/ubuntu hirsute-proposed Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

答案1

有相当全面的文档https://apt.pop-os.org/(使用搜索引擎也很容易找到)。

该网站列出了手动添加这些单独的标准存储库的命令。如果您愿意,您可以稍后将 resources.list.d/ 文件合并为一个,但据我所知,这没有任何优势。

没有方便的 pop!OS 安装,但通常 apt 在 /usr/share/doc/apt/examples 中提供最小的默认sources.list。

答案2

错误消息基本上表明http://apt.pop-os.org/proprietary存储库已在您的/etc/apt/sources.list.d/archive_uri-http_apt_pop-os_org_proprietary-hirsute.list文件中定义,大多数配置的存储库似乎不再包含代号为 的版本hirsute

您无法通过将配置恢复到安装发行版时的方式来解决此问题。相反,您必须找到如果hirsute版本已存档在某处,如果是,则指向该存档的正确存储库 URL;或者执行apt full-upgrade到之后的下一个版本hirsute,这将是impish.

apt包的包存储库定义具有.deb以下格式:

deb|deb-src <repository URL> <release codename> <section name...>

用简单的语言来说:该行以关键字 或 开头debdeb-src然后是存储库 URL、发布代号和一个或多个部分名称,所有部分均以空格分隔。

apt访问存储库时,它将这些元素放在一起形成实际的 URL,如下所示:

<repository URL>/dists/<release codename>/<section name>

<release codename>lsb_release -cs命令输出的内容;显然,它hirsute适用于您系统的当前状态。

按照此语法,您通常可以构建实际的 URL 并使用常规 Web 浏览器访问它们以验证存储库的状态:

  • http://apt.pop-os.org/proprietary/dists/bionic:该目录存在并包含版本、discoeoanfocalgroovyhirsuteimpish的子目录jammy。该hirsute子目录包含适当的存储库元数据文件、该部分的子目录(其中包含每个已发布的二进制体系结构的子目录)以及用于源包的main单独子目录。source存储库的这一部分可供您按原样使用。

  • http://apt.pop-os.org/release/dists/hirsute子目录不存在。仅存在impish和。jammy

  • http://apt.pop-os.org/staging-proprietary/dists/:就像proprietary上面的存储库一样,这个存储库对您来说似乎可以按原样使用。

  • http://apt.pop-os.org/staging/master/dists/:hirsute子目录不存在。仅bionicfocaljammy存在。

  • http://apt.pop-os.org/ubuntu/dists/: 有很多子目录,但没有hirsute, hirsute-security, hirsute-updates,hirsute-backports也没有hirsute-proposed。由于 URL 提到ubuntu,这似乎是包 Pop!_OS 的存储库,本质上是直接从 Ubuntu 的相应版本复制的。 Ubuntu 21.04“Hirsute Hippo”的支持终止日期为 2022 年 1 月 20 日,这意味着 Pop!_OS 不再能够对该版本提供上游支持。

根据维基百科的 Pop!_OS 发行表,对您当前版本的 Pop!_OS 的一般支持于 2022 年 1 月 22 日结束,并且对下一个该版本已于 2022 年 7 月结束。当前版本是 22.04 LTS(代号jammy),并且它是一个长期支持版本,因此如果可以的话最好使用该版本。但只能从 20.04(= 之前的 LTS 版本)或 21.10(=impish最新版本之前的版本)更新到 22.04。

根据Pop!_操作系统升级说明,旧版本的最后更新之一应该启用升级到新版本的选项。但是您已经等待太久了,System76.com 已经删除了大部分hirsute已过时的存储库,这导致了您当前的大部分问题。

风险由您自行承担,您可以尝试以下方法来获取impish版本:

  1. 备份所有重要数据。

  2. /etc/apt/sources.list.d/编辑目录和文件中的文件/etc/apt/sources.list,将出现的任何release关键字替换hirsuteimpish

  3. 运行sudo apt update并验证其运行没有错误。

  4. 运行sudo apt full-upgrade。如果因错误而停止,请尝试再次运行它,直到它报告没有进一步更新。然后重新启动并希望一切顺利。

  5. 如果成功,您现在应该处于版本 21.10“ impish”,您仍然可以按照 system76.com 的更新说明更新到当前版本(请参阅上面的链接)。

相关内容