Yes, I'm willing to get the latest version. I read some articles CentOS 7 doesn't support the latest versions. So was trying the old versions.
I tried the article shared but, got the below error at the step.
You have bigger problems to solve with your setup. Basic programs are failing to run, so there are other things that need fixing with your package manager that are completely unrelated to PostgreSQL.
Although Tom kindly responded to your initial question, this list (-hackers) is the wrong place to be asking that type of question, as its purpose is to discuss the *development* of PostgreSQL, not installation and upgrade issues.
There are many other places better suited to your question, including the pgsql-general list [1], IRC channel [2] and Slack channel [3].