It depends on what user you are executing these commands as and whether they own the /opt/PostgreSQL-14/ and related directories. Using "sudo" for the configure command seems very odd. One usually needs to use "sudo" on the "make install" command unless the user you are running these commands owns /opt/.... But I presume you know what your system needs here.
Anyway, you are missing some steps. I think it would be more like this:
tar zxvf <tarball>
./configure <as you like>
Personally, I install my source builds to separate directories for each version number. That way, I can "make install" without affecting the currently running server. Then, I use a script to change the symbolic links in the appropriate bin directory to point to the new version. This allows me to move the "make install" command to before the "pg_ctl stop" command. This results in even less downtime when switching to the new version, but that may not be necessary depending on your usage level. It also allows me to quickly revert to the previous version if there's a problem. I also don't use "pg_ctl" directly. I have a more sophisticated service script for stopping, starting, and restarting my PostgreSQL server which sets the environment variables appropriately and then executes the appropriate "pg_ctl" commands for me. If you do as well, substitute as appropriate.
Hope this helps,
On Sep 27, 2023, at 7:21 AM, Daulat <daulat.dba@xxxxxxxxx> wrote: