1

So I recently came across wsl and was trying to configure postgres with it but I am not able to do so, I am following these instruction - https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database but when I run the command: sudo apt install postgresql postgresql-contrib I receive this error -

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.

I have gone through some other answers related to this issue too and have tried running-

sudo aptitude install postgresql postgresql-contrib output:

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.

how should I solve this? I am using windows11, wsl 2(ubuntu)

NotTheDr01ds
  • 22,082

1 Answers1

0

This seems to be an issue with package handling in the GNU/Linux shell environment and not so much to do with WSL or PostgreSQL installation. I have only dealt with unmet dependencies in upgrades, but here is a thread showing the use of the 'f-option' that should help when it comes to these types of installs: How to automatically fetch missing dependencies when installing software from .deb?