postgresql - 在 Linux Mint 20.1 Ulyssa 64 位上安装 PostgreSQL 12 和 PgAdmin4 时出现问题
问题描述
我想在我的 Linux Mint 20.1 Ulyssa 64 位上安装 PostgreSQL 和 PgAdmin4
我的 inxi 信息
System: Kernel: 5.4.0-58-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: MATE 1.24.0 info: mate-panel
wm: marco 1.24.0 dm: LightDM 1.30.0 Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal
Machine: Type: Portable System: Dell product: Inspiron 3542 v: N/A serial: <filter> Chassis: type: 8 serial: <filter>
Mobo: Dell model: 0KHNVP v: A04 serial: <filter> UEFI: Dell v: A04 date: 08/05/2014
Battery: ID-1: BAT0 charge: 15.6 Wh condition: 27.7/41.4 Wh (67%) volts: 16.7/14.8 model: SMP-SDI2.8 DELL FW1MN31
type: Li-ion serial: <filter> status: Charging
CPU: Topology: Dual Core model: Intel Core i3-4005U bits: 64 type: MT MCP arch: Haswell rev: 1 L2 cache: 3072 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 13568
Speed: 798 MHz min/max: 800/1700 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798
Graphics: Device-1: Intel Haswell-ULT Integrated Graphics vendor: Dell driver: i915 v: kernel bus ID: 00:02.0
chip ID: 8086:0a16
Display: x11 server: X.Org 1.20.8 driver: modesetting unloaded: fbdev,vesa compositor: marco v: 1.24.0
resolution: 1366x768~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2) v: 4.5 Mesa 20.0.8 compat-v: 3.0 direct render: Yes
Audio: Device-1: Intel Haswell-ULT HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:03.0
chip ID: 8086:0a0c
Device-2: Intel 8 Series HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1b.0 chip ID: 8086:9c20
Sound Server: ALSA v: k5.4.0-58-generic
Network: Device-1: Broadcom and subsidiaries BCM43142 802.11b/g/n vendor: Dell Wireless 1704 802.11n + BT 4.0
driver: bcma-pci-bridge v: N/A port: f040 bus ID: 06:00.0 chip ID: 14e4:4365
Device-2: Realtek RTL810xE PCI Express Fast Ethernet vendor: Dell driver: r8169 v: kernel port: e000
bus ID: 07:00.0 chip ID: 10ec:8136
IF: enp7s0 state: down mac: <filter>
Drives: Local Storage: total: 494.66 GiB used: 9.07 GiB (1.8%)
ID-1: /dev/sda vendor: Toshiba model: MQ01ABF050 size: 465.76 GiB speed: 6.0 Gb/s rotation: 5400 rpm
serial: <filter> rev: 1D scheme: GPT
ID-2: /dev/sdb type: USB model: USB DISK 3.0 size: 28.90 GiB serial: <filter> rev: PMAP scheme: MBR
Partition: ID-1: / size: 95.62 GiB used: 8.97 GiB (9.4%) fs: ext4 dev: /dev/sda8
Sensors: System Temperatures: cpu: 47.0 C mobo: 46.0 C
Fan Speeds (RPM): cpu: 0
Repos: Active apt repos in: /etc/apt/sources.list
1: deb cdrom:[Linux Mint 20.1 _Ulyssa_ - Release amd64 20210103]/ focal contrib main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http://packages.linuxmint.com ulyssa main upstream import backport #id:linuxmint_main
2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
6: deb http://archive.canonical.com/ubuntu/ focal partner
Info: Processes: 184 Uptime: 1h 14m Memory: 3.75 GiB used: 671.3 MiB (17.5%) Init: systemd v: 245 runlevel: 5 Compilers:
gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 running in: mate-terminal inxi: 3.0.38
我按照https://www.postgresql.org/download/linux/ubuntu/的说明进行操作
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
我逐步执行了说明,并在第 3 步之后注意到日志中的错误消息
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.canonical.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Ign:4 http://mirror.yandex.ru/linuxmint-packages ulyssa InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:6 http://mirror.yandex.ru/linuxmint-packages ulyssa Release
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [844 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [436 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [264 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [750 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [558 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [303 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2 468 B]
Get:15 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1 768 B]
Hit:16 http://dl.google.com/linux/chrome/deb stable InRelease
Get:17 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Ign:18 http://apt.postgresql.org/pub/repos/apt ulyssa-pgdg InRelease
Err:19 http://apt.postgresql.org/pub/repos/apt ulyssa-pgdg Release
404 Not Found [IP: 147.75.85.69 80]
Hit:20 https://repo.skype.com/deb stable InRelease
Get:21 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24,3 kB]
Get:22 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [58,2 kB]
Error: Timeout was reached
Reading package lists... Done
E: The repository 'http://apt.postgresql.org/pub/repos/apt ulyssa-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.
然后我使用 inxi -r 检查了 repos
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http://mirror.yandex.ru/linuxmint-packages ulyssa main upstream import backport
2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
6: deb http://archive.canonical.com/ubuntu/ focal partner
Active apt repos in: /etc/apt/sources.list.d/pgdg.list
1: deb http://apt.postgresql.org/pub/repos/apt ulyssa-pgdg main
Active apt repos in: /etc/apt/sources.list.d/skype-stable.list
1: deb [arch=amd64] https://repo.skype.com/deb stable main
当我进行第 4 步 [c]sudo apt-get -y install postgresql[/c] 时,我得到了下一个结果:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 61709 (apt)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
我检查了 61709 进程。它是
root 61709 0.0 0.0 80208 1600 ? S мар13 0:23 /usr/bin/apt install bcmwl-kernel-source
查询:
- 我应该在安装 v 12 和 PgAdmin4 之前删除预安装的 PostgreSQL 和 PgAdmin3 吗?
- PosgreSQL 安装过程出了什么问题,怎么可能成功?
解决方案
- 重新启动您的 Linux Mint 笔记本电脑/服务器。
- 备份您的数据库并删除旧的 PostgreSQL 和 PgAdmin3。
- 按照此处的说明安装 PostgreSQL。