Before I used the installation commands stated in the question I am "almost" certain that I had used other commands to install postgres. The problem is that I had several versions installed.
I used this command pg_lsclusters
It will show the clusters and the ports the are using
12 main 5432 down,binaries_missing <unknown> /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
13 main 5433 online postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
I wasn't connecting to postgresql because I supposedly had purged version 12. But the task of removing postgresql is not as easy as installing it. The system was seeing Potgres as installed(even though th libs were missing) and was using the default port.
To use the right port use this command "psql --port 533'3'"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…