E: Unable to correct problems, you have held broken packages.

I am trying to install postgresql on whonix , I am using the latest version of Whonix on virtalbox .
root@host:/home/user# apt-get install postgresql postgresql-client
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-11 but it is not going to be installed
postgresql-client : Depends: postgresql-client-11 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Works for me in Qubes-Whonix 15.

Might be an issue not causes by Whonix but one of its components it is based on. See also:
Free Support for Whonix ™

Might take a while to debug this and there might even be no solution. If you like to try, see if the following commands make sense. And then to guess what’s next. The purpose is to find the root cause what is causing this.

sudo apt-get install postgresql postgresql-11

sudo apt-get install postgresql postgresql-client postgresql-11

I tried those commands they don’t work too ,
I solved the problem by installing them from Debian testing following the guide provided on : Install Additional Software Safely .
I am just concerned if this going to cause any security issues .

Please post the output here - this may require going back and forth multiple times.

user@host:~$ sudo apt-get install postgresql postgresql-11

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-11 : Depends: libicu52 (>= 52~m1-1~) but it is not installable
                 Depends: libssl1.0.0 (>= 1.0.0) but it is Preformatted textnot installable

E: Unable to correct problems, you have held broken packages.

The same output for :

sudo apt-get install postgresql postgresql-client postgresql-11
sudo apt install libicu52
sudo apt install libssl1.0.0

Also

sudo apt-get install postgresql postgresql-11 libicu52 libssl1.0.0

Did you add any third party repositories to /etc/apt/sources.list or /etc/apt/sources.list.d folder?
Did you install any deb packages without use of apt / apt-get?
Did you add Debian testing, unstable or any other repositories?

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libicu52 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libicu52’ has no installation candidate

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libssl1.0.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libssl1.0.0’ has no installation candidate

No I just installed whonix again , and I tried to install postgresql

never

yes , I added debian testing repository but it not the cause of the the issue because this happened before adding it .

These packages are not in Debian buster indeed.

This issue is most likely from mixing package sources.

Try in a newly imported Whonix - the issue is probably not reproducible there?

Packages postgresql postgresql-client are probably functional there.

By installing a package from Debian testing, dependencies might get messed up.

Do you mean re-install whonix again ?

The issue was solved using :
sudo apt-get -t bullseye install postgresql postgresql-client postgresql-11
is that okey ?

yes