I broke my msfconsole, help?


I am lost guys as what to do, i broke my metasploit trying to install a tool, i figured out the correct way to install but now when i try and get my msfconsole up it gives me a huge error message.

all i want to do is remove metasploit and then bring it back as a fresh install and i am lost as how to correctly do it. can anyone help me?

this is the error i am getting, not that it matters because i just want to reset, but ill put it here just in case.


(oaktree) #2

Please give us more information… Which OS, etc?


(Leader & Offsec Engineer & Forum Daddy) #3

So I see you’re using Kali…

Metasploit is a really tough one. I would recommend ditching Kali, booting up a fresh copy of Ubuntu, installing rvm, and installing all from fresh. Kali is an absolute nightmare with fixing anything or modification, perhaps reinstall Kali?

You’ll probably find the issue you’re having is due to either due to dependencies, or the version of ruby you’re using. Again. RVM fixes this issue.

Can you update msfconsole with msfupdate and report back?


([email protected] [email protected]) #4

Indeed, Kali can be rough. In fact, I recently broke my apt install and it took me a couple of days to figure out that I had somehow “upgraded” to the apt:i386 version which doesn’t work on my setup just yet. (I know, shoot me dead for not making it multi arch. as soon as I installed.)
Also, Ubuntu??? As opposed to masterrace Debian Linux??? :joy::joy: I am certainly a fanboy ROFL.

As for msfconsole, you’re gonna want to try this:
apt-get reinstall metasploit-framework metasploit-common msfpc ruby-msfrpc-client

If that didn’t work, try this:
apt-get remove metasploit-framework metasploit-common msfpc ruby-msfrpc-client

and then:

apt-get install metasploit-framework metasploit-common msfpc ruby-msfrpc-client

Now, don’t get me wrong, I’m not 100% absolutely sure that this will work, but it’s the best solution I can come up with if you really must stick with Kali. Following with what @pry0cc said, Make sure your ruby version is compatible with your Metasploit version as well.


  1. Make sure you’re running the latest version of Kali.
  2. Make sure you start the postgresql service before starting metasploit. (though, iirc, this shouldn’t stop your from using msfconsole, and postgresql not running will just disable database capabilities.)
  3. See if this helps your situation:
    chown -R /usr/share/metasploit
    apt-get install ruby-dev
    I think you’re missing out on permissions, though root should always be able to access them, its worth a try
  4. RVM is not really needed unless you’re working with two or more ruby versions together simultaneously. A regular ruby install or as provided by your distro packagers should be alright. Though, it has always made things easier than difficult.
  5. If nothing works, try removing metasploit and then reinstalling it.
1 Like


Did it work for you, @Bugsy ?



hey thanks again everyone! @Kowalski Yes it worked! i followed your commands to re install ruby-dev in my metasploit. thanks again! i meant to get back sooner but i got busy with work.


(oaktree) closed #8