我正在使用 Linux Mint Cinnamon 21.3 Virginia。我最近安装了 PostgreSQL 并且安装成功。但是,现在包管理器似乎存在一些问题。运行时sudo apt-get update
出现以下错误:
Err:9 https://apt.postgresql.org/pub/repos/apt virginia-pgdg Release
404 Not Found [IP: 147.75.85.69 443]
E: The repository 'https://apt.postgresql.org/pub/repos/apt virginia-pgdg 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.
基于此的答案StackOverflow问题,我尝试过以下方法:
- 将 apt 存储库的 URL 更改为 apt-archive。为此,我编辑
/etc/apt/sources.list.d/pgdg.list
并更改deb https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg main
为deb https://apt.postgresql.org/pub/repos/apt virginia-pgdg main
.但是,这样做时,我收到一个新错误:
Err:12 https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg InRelease
403 Forbidden [IP: 13.32.121.36 443]
E: Failed to fetch https://apt-archive.postgresql.org/pub/repos/apt/dists/virginia-pgdg/InRelease 403 Forbidden [IP: 13.32.121.36 443]
E: The repository 'https://apt-archive.postgresql.org/pub/repos/apt virginia-pgdg InRelease' is not signed.
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.
- 安装存储库签名密钥PostgreSQL 官方安装说明。这并不能解决任何问题。
- 将我的 Linux Mint 版本的代号更改为基于 Linux Mint 21.3 的 Ubuntu 版本,Linux Mint 21.3 基于 Ubuntu 22.04 (Jammy Jellyfish),因此我将其更改
/etc/apt/sources.list.d/pgdg/list
为deb https://apt.postgresql.org/pub/repos/apt jammy-pgdg main
.这会引发一个新的警告:
Get:10 https://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 Packages [297 kB]
W: https://apt.postgresql.org/pub/repos/apt/dists/jammy-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease' doesn't support architecture 'i386'
由于我使用的是 amd64 架构,所以我不担心 32 位机器上的 i386 架构不受支持。但是如何在每次运行 apt update 命令时禁用此警告?
答案1
要基于 Linux Mint Virginia 在 Linux Mint Virginia 上设置 postgresql apt 存储库jammy
,请使用:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc |
sudo tee /usr/share/keyrings/pgdg.pgp
echo "deb [signed-by=/usr/share/keyrings/pgdg.pgp arch=amd64] https://apt.postgresql.org/pub/repos/apt jammy-pgdg main" |
sudo tee /etc/apt/sources.list.d/pgdg.list
postgresql
对于一般用途,要在 Linux Mint 上安装:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc |
sudo tee /usr/share/keyrings/pgdg.pgp
echo "deb [signed-by=/usr/share/keyrings/pgdg.pgp arch=amd64] https://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo "$UBUNTU_CODENAME")-pgdg main" |
sudo tee /etc/apt/sources.list.d/pgdg.list
将. /etc/os-release && echo "$UBUNTU_CODENAME"
打印 Ubuntu 代号而不是lsb_release -cs
.
添加[arch=amd64]
以禁用...doesn't support architecture 'i386'...
警告。