首页 > 解决方案 > 无法安装 PostgreSQL 9.6:取决于:libssl1.0.0 (>= 1.0.0) 但无法安装

问题描述

Linux Mint 20.2

我想安装 PostgreSQL 9.6

这是我的步骤(以root身份运行):

1. Add `deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main` to `/etc/apt/sources.list.d/postgresql.list`
2. Add key to sys: `wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -`
3. apt-get update && apt-get install postgresql-9.6

但我收到错误(在最后一步之后):

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                           
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                                                                                                
Hit:4 http://archive.canonical.com/ubuntu focal InRelease                                                                                                                              
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                                               
Ign:6 http://packages.linuxmint.com uma InRelease                                                                                            
Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]                                                                    
Hit:8 http://packages.linuxmint.com uma Release                                                                
Hit:9 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease            
Fetched 328 kB in 1s (460 kB/s)                          
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql-9.6 : Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
                  Recommends: postgresql-contrib-9.6 but it is not going to be installed
                  Recommends: sysstat but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

附言

资料详情:

inxi -Fxxxrz
System:    Kernel: 5.4.0-74-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Console: tty 10 dm: LightDM 1.30.0 
           Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: HP product: HP ProDesk 600 G6 Microtower PC v: N/A serial: <filter> Chassis: type: 3 
           serial: <filter> 
           Mobo: HP model: 8712 v: KBC Version 09.94.00 serial: <filter> UEFI: HP v: S02 Ver. 02.05.01 date: 01/05/2021 
CPU:       Topology: 6-Core model: Intel Core i5-10500 bits: 64 type: MT MCP arch: N/A L1 cache: 384 KiB L2 cache: 12.0 MiB 
           L3 cache: 12.0 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 74399 
           Speed: 4359 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 4337 2: 3680 3: 4186 4: 4348 5: 3925 6: 4119 7: 4090 
           8: 4314 9: 4380 10: 4337 11: 3374 12: 4350 
Graphics:  Device-1: Intel vendor: Hewlett-Packard driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:9bc8 
           Display: server: X.org 1.20.9 driver: modesetting unloaded: fbdev,vesa tty: 198x49 
           Message: Advanced graphics data unavailable in console for root. 
Audio:     Device-1: Intel Comet Lake PCH cAVS vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:06c8 
           Device-2: Plantronics Audio 655 DSP type: USB driver: plantronics,snd-usb-audio,usbhid bus ID: 1-2.4:4 
           chip ID: 047f:c008 
           Sound Server: ALSA v: k5.4.0-74-generic 
Network:   Device-1: Intel Ethernet I219-LM vendor: Hewlett-Packard driver: e1000e v: 3.2.6-k port: efa0 bus ID: 00:1f.6 
           chip ID: 8086:0d4c 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 238.47 GiB used: 17.38 GiB (7.3%) 
           ID-1: /dev/nvme0n1 model: KBG40ZNV256G KIOXIA size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> 
           rev: HP00AE00 scheme: GPT 
Partition: ID-1: / size: 233.24 GiB used: 17.38 GiB (7.5%) fs: ext4 dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 38.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
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://packages.linuxmint.com uma 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
           Active apt repos in: /etc/apt/sources.list.d/pgdg.list 
           1: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
Info:      Processes: 336 Uptime: 1h 17m Memory: 30.72 GiB used: 2.81 GiB (9.1%) Init: systemd v: 245 runlevel: 5 Compilers: 
           gcc: 9.3.0 alt: 9 Shell: bash v: 5.0.17 running in: tty 10 inxi: 3.0.38 

标签: postgresqllinux-mint

解决方案


如果 docker 不是一个选项,请安装一个较旧的 linux 发行版,其中 libssl 1.0.0 可用。例如,Linux Mint 19 Tara。如果更改发行版或使用其他虚拟化软件(如 qemu/virtualbox)也不是一种选择,您可以尝试从源代码重建旧的 libssl 和其他依赖项。然后重建旧的 PostgreSQL,将构建过程指向已编译的依赖项。


推荐阅读