Results 1 to 5 of 5

Thread: "Sub-process /usr/bin/dpkg returned an error code (1)"

  1. #1
    Join Date
    2014-Dec
    Location
    Indianapolis, Indiana
    Posts
    105

    "Sub-process /usr/bin/dpkg returned an error code (1)"

    Hi, I have Kali Linux on a 256GB Encrypted Live USB. And a Kali Guest on VMware and Windows 10 Host. My question is about my Live USB. While updating I get the error: "E: Sub-process /usr/bin/dpkg returned an error code (1)." I tried my usual "sudo dpkg --configure -a" and got another error. It was about cherrytree. So I ran "sudo apt remove cherrytree" and got the repsonse:

    "dpkg: error processing package cherrytree (--configure):
    package is in a very bad inconsistent state; you should
    reinstall it before attempting configuration
    Errors were encountered while processing:
    cherrytree"

    Now when I run update I get:

    "Errors were encountered while processing:
    /var/cache/apt/archives/cherrytree_0.99.9~git20200901-0kali1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)"

    I tried "sudo apt-get dist-upgrade" and "sudo apt-get install -f." Update still has error

    "Errors were encountered while processing:
    /var/cache/apt/archives/cherrytree_0.99.9~git20200901-0kali1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)"

    So, then I tried: "cd /var/cache/apt/archives" and "sudo dpkg -i --force-overwrite cherrytree_0.99.9~git20200901-0kali1_amd64.deb." I got the error:

    "(Reading database ... 382007 files and directories currently installed.)
    Preparing to unpack cherrytree_0.99.9~git20200901-0kali1_amd64.deb ...
    FAIL: unknown command-line parameter "/usr/bin/pyclean"
    [hint] did you want "--/usr/bin/pyclean"?
    dpkg: warning: old cherrytree package pre-removal script subprocess returned error exit status 1
    dpkg: trying script from the new package instead ...
    dpkg: error processing archive cherrytree_0.99.9~git20200901-0kali1_amd64.deb (--install):
    there is no script in the new version of the package - giving up
    FAIL: unknown command-line parameter "/usr/bin/pycompile"
    [hint] did you want "--/usr/bin/pycompile"?
    dpkg: error while cleaning up:
    installed cherrytree package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    cherrytree_0.99.9~git20200901-0kali1_amd64.deb"

    I also tried "sudo apt-get install cherrytree." Still not updating. I do not know why "sudo dpkg --configure -a" and "sudo apt-get install -f" are not working. They have in the past. And also "sudo apt-get --fix-broken install" wont work. Same error "E: Sub-process /usr/bin/dpkg returned an error code (1)." And I guess I shouldn't have removed cherrytree. So can anyone tell me how to get dpkg working? I don't want to erase and recreate my Live USB. So I need to know how to fix it without. Reply if you need any Logs. Please reply. Thanks

  2. #2
    Join Date
    2014-Dec
    Location
    Indianapolis, Indiana
    Posts
    105
    I'm back...Now I can't install anything on my Kali Live USB. "apt" "apt-get" "dpkg" (and no update.) I found that if I enter "/usr/bin/dpkg" instead of just dpkg it works. Very weird I do not know why it does that. But now I need to install cherrytree so I can continue with my "apt-get update && apt-get upgrade && apt-get dist-upgrade. That gives the error dpkg error 1 (above) now says:

    "Errors were encountered while processing:
    /var/cache/apt/archives/cherrytree_0.99.9~git20200901-0kali1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)"

    I tried "sudo /usr/bin/dpkg --configure -a" and got the error:

    "Errors were encountered while processing:
    cherrytree"

    "dpkg: error processing package cherrytree (--configure):
    package is in a very bad inconsistent state; you should
    reinstall it before attempting configuration"

    So how do I install cherrytree so I can continue "dpkg --configure -a"? I looked into installing it with "snap install cherrytree", but it gives an error about no connection. (I never use snap.) The status is off. (snapd.socket listening but not snapd.services.) I would probably have to reinstall snap. But I can't with no apt apt-get dpkg!! So please reply with any help. I think if I could get cherrytree running I can run dpkg --configure -a and everything would work. I tried "/var/cache/apt/archives" folder with new .deb's but I get the dpkg error (above.) And I can't install aptitude. (I tried "apt install" above.) Please reply so I can get this fixed. Thanks

  3. #3
    Join Date
    2014-Dec
    Location
    Indianapolis, Indiana
    Posts
    105
    I figured it out. I found two webpages...

    https://askubuntu.com/questions/1487...nt-state-error

    https://askubuntu.com/questions/5654...-what-can-i-do

    First entered...

    sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
    sudo dpkg --remove --force-remove-reinstreq --force-depends <packagename>
    sudo apt-get remove <packagename>
    sudo apt-get autoremove && sudo apt-get autoclean
    sudo apt-get -f install

    Then I ran "sudo dpkg --configure -a" and got an error about "python-chardet." So I used the second link and ran...

    apt-get download python2.7-minimal ## at least this package is necessary
    sudo touch /usr/bin/python2.7 && sudo chmod +x /usr/bin/python2.7
    sudo dpkg --unpack python2.7-minimal*

    Then I ran...
    "sudo dpkg --configure -a
    sudo apt-get -f install"

    And now I can "apt-get update" and "apt-get upgrade." And "dpkg" works. And I didn't have to format and create a new Kali Live USB. Super happy!

  4. #4
    Join Date
    2021-Jan
    Posts
    2
    hello i am new here i am going to try your fix on this error. i hope it works. thank you in advance.
    sudo apt-get update && sudo apt-get -f install libcommons-cli-java



    Hit:1 http://kali.download/kali kali-rolling InRelease
    Reading package lists... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libcommons-cli-java is already the newest version (1.4-2).
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    3 not fully installed or removed.
    Need to get 0 B/57.3 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    dpkg: error processing package libcommons-cli-java (--configure):
    package is in a very bad inconsistent state; you should
    reinstall it before attempting configuration
    dpkg: dependency problems prevent configuration of apktool:
    apktool depends on libcommons-cli-java; however:
    Package libcommons-cli-java is not configured yet.

    dpkg: error processing package apktool (--configure):
    dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of kali-tools-reverse-engineering:
    kali-tools-reverse-engineering depends on apktool; however:
    Package apktool is not configured yet.

    dpkg: error processing package kali-tools-reverse-engineering (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    libcommons-cli-java
    apktool
    kali-tools-reverse-engineering
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  5. #5
    Join Date
    2021-Jan
    Posts
    2
    thanks again mike my final result by the time i got to apt-get -f install is this


    sudo apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Correcting dependencies... Done
    The following additional packages will be installed:
    libcommons-cli-java
    The following NEW packages will be installed:
    libcommons-cli-java
    0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
    2 not fully installed or removed.
    Need to get 0 B/57.3 kB of archives.
    After this operation, 84.0 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Selecting previously unselected package libcommons-cli-java.
    (Reading database ... 181818 files and directories currently installed.)
    Preparing to unpack .../libcommons-cli-java_1.4-2_all.deb ...
    Unpacking libcommons-cli-java (1.4-2) ...
    Setting up libcommons-cli-java (1.4-2) ...
    Setting up apktool (2.4.1-1) ...
    Setting up kali-tools-reverse-engineering (2021.1.3) ...



    now if i can get sound and network manager working.

Similar Threads

  1. E: Sub-process /usr/bin/dpkg returned an error code (1)
    By LucaWebs in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-09-03, 02:02
  2. Replies: 2
    Last Post: 2019-02-18, 22:18
  3. E: Sub-process /usr/bin/dpkg returned an error code (1)
    By trevordeonmpofu in forum Building Archive
    Replies: 0
    Last Post: 2018-12-21, 10:32

Posting Permissions

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