MacPorts From Source

If somehow installing .pkg does not work in your system, you can compile it by yourself. This method works almost in all major Mac OS X versions from Tiger to Monterey.

Download latest release source from here. Also you will need Xcode already installed in your system.

unzip macports-base-x.x.x.zip
cd macports-base-xxxxxxx
./configure
make
sudo make install
export PATH=/opt/local/bin:$PATH
sudo port -v selfupdate
sudo port -v upgrade outdated