首先

以root权限执行

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall

然后

待安装完以后,以非root用户启动,会显示

** Welcome to Metasploit Framework Initial Setup **
    Please answer a few questions to get started.
Would you like to use and setup a new database (recommended)? 
Please answer yes or no.
Would you like to use and setup a new database (recommended)? yes
Creating database at /home/lujinli/.msf4/db
Starting database at /home/lujinli/.msf4/db...success
Creating database users
Creating initial database schema
msf > db_status 
[*] postgresql connected to msf

就可以愉快的玩耍了