Results 1 to 16 of 16

Thread: apt-get automatically tries to update metasploit, causing dpkg to exit unexpectedly.

  1. #1
    Join Date
    2013-Jun
    Posts
    4

    Unhappy apt-get automatically tries to update metasploit, causing dpkg to exit unexpectedly.

    So, my problem seems to be a problem with Metasploit. first, when I use apt-get, it always tries to update metasploit. when it does this, it is all fine until the part which says: "Stopping Metasploit web server: thin". It then says"E: Sub-process /usr/bin/dpkg exited unexpectedly". The next time I try to use apt-get, it says "E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.". So I do that. But the next time I try to use apt-get it still tries to automatically update Metasploit. And fails. It just keeps repeating. I am currently using a 16 gigabyte USB with persistence on kali, booted into a HP Pavillion a6807c PC that was manufactured in 2007.

  2. #2
    Join Date
    2013-Mar
    Posts
    4
    Hi optimusprimeduck. I've seen this issue before but have been unable to reproduce it. One thing you can do to get back to normal is to manually stop and remove metasploit:

    /etc/init.d/metasploit stop
    rm /etc/init.d/metasploit
    dpkg --purge metasploit
    dpkg --configure -a
    apt-get update
    apt-get upgrade

    I will continue to look for the root cause of this issue.

  3. #3
    Join Date
    2013-Jun
    Posts
    4
    Unfortunately, at dpkg --purge metasploit, I end up with:

    dpkg: error processing metasploit (--purge):
    Package is in a very bad inconsistent state - you should
    reinstall it before attempting a removal.
    Errors were encountered while processing:
    metasploit

  4. #4
    Join Date
    2013-Jun
    Posts
    5
    Have you tryied reinstalling it?
    Code:
    aptitude reinstall metasploit

  5. #5
    Join Date
    2013-Jun
    Posts
    4
    I tried, but this is what I end up with:

    The following packages will be REMOVED:
    metasploit
    0 packages upgraded, 0 newly installed, 1 to remove and 177 not upgraded.
    Need to get 0 B of archives. After unpacking 163 MB will be freed.
    Do you want to continue? [Y/n/?] y
    dpkg: error processing metasploit (--remove):
    Package is in a very bad inconsistent state - you should
    reinstall it before attempting a removal.
    Errors were encountered while processing:
    metasploit
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:

    Current status: 178 updates [+1].

  6. #6
    Join Date
    2013-Mar
    Posts
    22
    Quote Originally Posted by optimusprimeduck View Post
    I tried, but this is what I end up with:

    The following packages will be REMOVED:
    metasploit
    0 packages upgraded, 0 newly installed, 1 to remove and 177 not upgraded.
    Need to get 0 B of archives. After unpacking 163 MB will be freed.
    Do you want to continue? [Y/n/?] y
    dpkg: error processing metasploit (--remove):
    Package is in a very bad inconsistent state - you should
    reinstall it before attempting a removal.
    Errors were encountered while processing:
    metasploit
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    A package failed to install. Trying to recover:

    Current status: 178 updates [+1].

    Same Error , please someone help .

  7. #7
    Join Date
    2013-Mar
    Location
    milano
    Posts
    301
    Quote Originally Posted by Mehran View Post
    Same Error , please someone help .
    i make test in vm live(1.0.4)64bit & seem to work in MY-kali ...but....I am not responsible if your kali "" broken""
    try:
    apt-get remove metasploit-framework (this remove metasploit & some """dipendence-tools"")
    apt-get update
    apt-get install metasploit metasploit-framework set ikat armitage jboss-autopwn kali-linux kali-linux-full set u3-pwn -y
    ....
    after for metasploit start the "service"(service metasploit start && service postgresql start) and launch msfconsole
    bye

  8. #8
    Join Date
    2013-Mar
    Posts
    17
    First start postgresql and metasploit services then run apt-get update && apt-get upgrade....

    Code:
    service postgresql start && service metasploit start
    apt-get update
    apt-get upgrade
    there is no need to remove metasploit and reinstall it.

  9. #9
    Join Date
    2013-Mar
    Posts
    22
    Quote Originally Posted by system_crash View Post
    First start postgresql and metasploit services then run apt-get update && apt-get upgrade....

    Code:
    service postgresql start && service metasploit start
    apt-get update
    apt-get upgrade
    there is no need to remove metasploit and reinstall it.

    i did it But i got This error :

    Code:
    Preparing to replace metasploit 4.6.2-2013061901-1kali0 (using .../metasploit_4.7.0-2013072401-1kali0_i386.deb) ...
    [....] Stopping Metasploit web server: thinE: Sub-process /usr/bin/dpkg exited unexpectedly

  10. #10
    Join Date
    2013-Mar
    Posts
    22
    Quote Originally Posted by zimmaro View Post
    i make test in vm live(1.0.4)64bit & seem to work in MY-kali ...but....I am not responsible if your kali "" broken""
    try:
    apt-get remove metasploit-framework (this remove metasploit & some """dipendence-tools"")
    apt-get update
    apt-get install metasploit metasploit-framework set ikat armitage jboss-autopwn kali-linux kali-linux-full set u3-pwn -y
    ....
    after for metasploit start the "service"(service metasploit start && service postgresql start) and launch msfconsole
    bye
    i Cannot Remove metasploit :

    root@kali:~# apt-get remove metasploit-framework
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
    metasploit metasploit-framework
    0 upgraded, 0 newly installed, 2 to remove and 30 not upgraded.
    1 not fully installed or removed.
    After this operation, 232 MB disk space will be freed.
    Do you want to continue [Y/n]? Y
    dpkg: error processing metasploit (--remove):
    Package is in a very bad inconsistent state - you should
    reinstall it before attempting a removal.
    (Reading database ... 255120 files and directories currently installed.)
    Removing metasploit-framework ...
    dpkg: warning: while removing metasploit-framework, directory '/usr/share/metasploit-framework/data/meterpreter' not empty so not removed
    Errors were encountered while processing:
    metasploit
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  11. #11
    Join Date
    2013-Jul
    Posts
    20
    Quote Originally Posted by Mehran View Post
    i Cannot Remove metasploit :
    Your error message refers to your meterpreter directory. What is the result of "ls /usr/share/metasploit-framework/data/meterpreter"? Could you move the contents of that folder somewhere else and then try to remove metasploit?

  12. #12
    Join Date
    2013-Mar
    Posts
    22
    Quote Originally Posted by jackpwns View Post
    Your error message refers to your meterpreter directory. What is the result of "ls /usr/share/metasploit-framework/data/meterpreter"? Could you move the contents of that folder somewhere else and then try to remove metasploit?
    Code:
    root@kali:~# ls /usr/share/metasploit-framework/data/meterpreter
    elevator.dll                   ext_server_sniffer.x64.dll
    elevator.x64.dll               ext_server_stdapi.dll
    ext_server_espia.dll           ext_server_stdapi.jar
    ext_server_espia.x64.dll       ext_server_stdapi.lso
    ext_server_incognito.dll       ext_server_stdapi.php
    ext_server_incognito.x64.dll   ext_server_stdapi.x64.dll
    ext_server_lanattacks.dll      metcli.exe
    ext_server_lanattacks.x64.dll  meterpreter.jar
    ext_server_mimikatz.dll        meterpreter.php
    ext_server_mimikatz.x64.dll    metsrv.dll
    ext_server_networkpug.lso      metsrv.x64.dll
    ext_server_pivot.dll           metsvc.exe
    ext_server_pivot.x64.dll       metsvc-server.exe
    ext_server_priv.dll            msflinker_linux_x86.bin
    ext_server_priv.x64.dll        screenshot.dll
    ext_server_sniffer.dll         screenshot.x64.dll
    ext_server_sniffer.lso
    i Also move all in meterpreter folder but still cant remove Metasploit :

    Code:
    root@kali:~# apt-get remove metasploit-framework 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      metasploit metasploit-framework
    0 upgraded, 0 newly installed, 2 to remove and 30 not upgraded.
    1 not fully installed or removed.
    After this operation, 232 MB disk space will be freed.
    Do you want to continue [Y/n]? Y
    dpkg: error processing metasploit (--remove):
     Package is in a very bad inconsistent state - you should
     reinstall it before attempting a removal.
    (Reading database ... 255120 files and directories currently installed.)
    Removing metasploit-framework ...
    Errors were encountered while processing:
     metasploit
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Code:
    root@kali:~# apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these.
    The following packages have unmet dependencies:
     metasploit : Depends: metasploit-framework (>= 4.6.2-2013061901-1) but it is not installed
    E: Unmet dependencies. Try using -f.
    Code:
    root@kali:~# apt-get -f install
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following extra packages will be installed:
      metasploit metasploit-framework
    The following NEW packages will be installed:
      metasploit-framework
    The following packages will be upgraded:
      metasploit
    1 upgraded, 1 newly installed, 0 to remove and 34 not upgraded.
    1 not fully installed or removed.
    Need to get 0 B/140 MB of archives.
    After this operation, 101 MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Reading changelogs... Done
    Selecting previously unselected package metasploit-framework.
    (Reading database ... 246871 files and directories currently installed.)
    Unpacking metasploit-framework (from .../metasploit-framework_4.7.0-2013072401-1kali0_i386.deb) ...
    Selecting previously unselected package metasploit.
    Preparing to replace metasploit 4.6.2-2013061901-1kali0 (using .../metasploit_4.7.0-2013072401-1kali0_i386.deb) ...
    [....] Stopping Metasploit web server: thinE: Sub-process /usr/bin/dpkg exited unexpectedly

  13. #13
    Join Date
    2013-Aug
    Posts
    3

    Exact same issue

    I feel your pain. I also get this exact same error process. It started after I did apt-get update followed by apt-get upgrade from a Kali terminal. I don't know if it makes a difference but I am running Kali as a VM in VB. I ended up hosing the thing and reinstalling the whole VM from scratch. Every time I try and update either when it was BT5 R3 or Kali, Metasploit stopped working and despite several suggestions from other forums I have never recovered and always had to reinstall. Was a fix ever found for the above problem. Is there a better way to update Kali as at present I just don't do it anymore because it always breaks something (usually Metasploit) Thanks

  14. #14
    Join Date
    2013-Mar
    Posts
    7
    Had this problem for a few weeks now. But I somehow got it fixed last night, following brandont and zimmaro's suggestions. Went as far as apt-get update then issued apt-get remove metasploit-framework. Encountered the error about the meterpreter directory not being empty so rm'ed them. Issued another apt-get remove metasploit-framework and got another error about unmet dependencies so I tried apt-get -f install. Everything went smooth after that. No more errors. Lastly, apt-get install --reinstall metasploit-framework to see if I'd encounter the error again. No errors. Was able to apt-get upgrade the other packages.

  15. #15
    Join Date
    2013-Mar
    Posts
    34
    Quote Originally Posted by hdcase View Post
    Had this problem for a few weeks now. But I somehow got it fixed last night, following brandont and zimmaro's suggestions. Went as far as apt-get update then issued apt-get remove metasploit-framework. Encountered the error about the meterpreter directory not being empty so rm'ed them. Issued another apt-get remove metasploit-framework and got another error about unmet dependencies so I tried apt-get -f install. Everything went smooth after that. No more errors. Lastly, apt-get install --reinstall metasploit-framework to see if I'd encounter the error again. No errors. Was able to apt-get upgrade the other packages.
    Thank you so much! This fixed my problem for me. God, it was so annoying. I'm going to bookmark this so I can always fix it when it inevitably comes back again.

  16. #16
    Join Date
    2013-Sep
    Posts
    1

    error solved

    Quote Originally Posted by optimusprimeduck View Post
    So, my problem seems to be a problem with Metasploit. first, when I use apt-get, it always tries to update metasploit. when it does this, it is all fine until the part which says: "Stopping Metasploit web server: thin". It then says"E: Sub-process /usr/bin/dpkg exited unexpectedly". The next time I try to use apt-get, it says "E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.". So I do that. But the next time I try to use apt-get it still tries to automatically update Metasploit. And fails. It just keeps repeating. I am currently using a 16 gigabyte USB with persistence on kali, booted into a HP Pavillion a6807c PC that was manufactured in 2007.
    rm /opt/metasploit/apps/pro/ui/log/thin.pid
    apt-get upgrade

Similar Threads

  1. Nexus 9 - apt-get update causing android crash
    By 11552 in forum NetHunter General Questions
    Replies: 5
    Last Post: 2017-02-12, 01:52
  2. Dpkg error after new install of Kali when trying to update
    By 3lackho1e in forum Installing Archive
    Replies: 0
    Last Post: 2016-11-16, 19:09
  3. Kali 2.0 : apt-get update python3-lxml dpkg error
    By cmf in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2015-09-10, 08:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •