tested on ubuntu/jammy
as root
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \ chmod 755 msfinstall && \ ./msfinstall
see install
as user
msfconsole -q Would you like to use and setup a new database (recommended)? yes
https://www.metasploit.com/download
https://docs.metasploit.com/docs/using-metasploit/getting-started/nightly-installers.html
https://docs.rapid7.com/metasploit/installing-the-metasploit-framework/