所以我最近遇到了 wsl,并试图用它来配置 postgres,但我无法这样做,我按照以下说明进行操作 -https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database
但是当我运行命令时:
sudo apt install postgresql postgresql-contrib
我收到这个错误 -
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 : Depends: postgresql-13 but it is not going to be installed
postgresql-contrib : Depends: postgresql-contrib-13
E: Unable to correct problems, you have held broken packages.
我也经历过一些与此问题相关的其他答案,并尝试运行 -
sudo aptitude install postgresql postgresql-contrib
输出:
The following NEW packages will be installed:
libllvm6.0{a} libpq5{ab} postgresql postgresql-13{ab} postgresql-client-13{ab} postgresql-contrib sysstat{a}
0 packages upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.3 MB of archives. After unpacking 121 MB will be used.
The following packages have unmet dependencies:
libpq5 : Depends: libssl1.0.0 (>= 1.0.2~beta3) which is a virtual package and is not provided by any available package
postgresql-13 : Depends: libicu55 (>= 55.1-1~) which is a virtual package and is not provided by any available package
Depends: libssl1.0.0 (>= 1.0.2~beta3) which is a virtual package and is not provided by any available package
postgresql-client-13 : Depends: libreadline6 (>= 6.0) which is a virtual package and is not provided by any available package
Depends: libssl1.0.0 (>= 1.0.0) which is a virtual package and is not provided by any available package
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libpq5 [Not Installed]
2) postgresql [Not Installed]
3) postgresql-13 [Not Installed]
4) postgresql-client-13 [Not Installed]
5) postgresql-contrib [Not Installed]
Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
我该如何解决这个问题?我正在使用 windows11、wsl 2(ubuntu)