How to Fix Cydia Could not open file /var/lib/dpkg/status

The problem: I jailbroke my iOS device using Yalu Jailbreak. Upon opening Cydia, it’s showing “Could not open file /var/lib/dpkg/status — open (2: No such file or directory). This package lists or status file could not be parsed or opened.”

Is there a solution? Yes!

database-error-cydia

Fix Cydia Could Not Open File /Var/lib/dpkg/status

Some users have tried to use the “Erase All Content and Settings” option in their Settings app, but that didn’t resolve this problem.

Here are the steps:

  1. Download the NewTerm .deb from here
  2. Mac users can use iOS App Signer to turn it from .deb to .iPA. Windows users can follow this video or this.
  3. Download Cydia Impactor from here and sideload the MobileTerminal.ipa to your iOS device
  4. Go to the official site of i-Funbox and download it.
  5. Download the “lib.zip” file from Mediafire.
  6. Open iFunbox and navigate to /var/mobile/Media/Books then import the ‘lib’ folder to that directory

Last but not least, open MobileTerminal on your iPhone or iPad and type in the following commands.

type su

type in your password. default is alpine

type: cp -R /var/mobile/Media/Books/lib /var

Cydia should start working again. For those who have either iFile or Filza and Mobile Terminal installed already, you can start from Step 4 and forward.

How to Fix com.teiron.pphelper error in Cydia

When I finished troubleshooting the “Could Not Open File…” error there is another one that pop out and this one says something like this:

trying to overwrite ‘/Library/MobileSubstrate/DynamicLibraries’, which is also in package com.teiron.pphelperns

This problem is a bit easier to resolve since it doesn’t require a computer or installing another app. Switch over to the Installed tab and look for an app called PP Helper. Go ahead and uninstall that tweak. Respring your iOS device, and you can start installing Cydia tweaks as usual again.

ForkException Error

I received several messages today from readers asking about a new error in Mobile Terminal that says: “Not allowed to fork from inside Sandbox.” This error message usually appears when your iOS device is not in a jailbroken state. If your iPhone or iPad is running 9.x.x, then use the Pangu app to re-jailbreak it.

Cydia is Showing DPKG_LOCKED

This problem appears when a user is trying to install a package from Cydia, and during the installation, it shows the DPKG_locked error.

If you want to fix this problem, try the following steps:

  1. Just like the tutorial above, we’re going to need some sort of SSH client to login into our device. I recommend using PuTTY regardless of your computer OS (Windows or Mac).
  2. Connect your iPhone to the computer
  3. Open PuTTY and enter the following info t it: Host IP: 127.0.0.1 and Port 22
  4. Your login credentials will be root / alpine (default password)
  5. Now type in the following command: dpkg –configure -a
  6. Press enter and then logout of the screen

After you disconnect your iOS device, try to open the Cydia and install a tweak from the Changes tab. See if the error continues to show up. If it does, comment down below the error code, and we’ll try to help.

Leave a Comment

  1. realy you are awesome dude it works for me thank you soooo much man, you can drag the lib file on file systeme RAW and then on Books directly it’s the same

    Reply
  2. Hey quick question, when I open up ifunbox, i can not find the navigation listed above. There is no var/mobile options, looked through all the folders and everything. What am i missing? i dowloaded the terminal and it is installed on my device, downloaded iphonebox, but can find the proper navigation to drop the lib file into

    Reply
  3. Hey I have the exact problem and I followed your steps until using iFunbox moving file step.
    I couldn’t do it because according to ifunbox im not jail-broken yet. But according to pangu app, it says your phone is jail-broken.
    What happened to me before was I jail broken it and rebooted my phone and tried to reactivate the jailbreak, but it always led me to a dark screen. So I erased all my data and reset my phone from settings thinking I could do the whole thing from zero. But the Cydia app is still there no matter how I reset it.
    I didn’t back up because I didn’t have any valuable data in my phone, so I couldn’t restore to back up to remove cydia, but I don’t want to restore my phone from itunes which will update the ios to unjailbreakable new ios version.
    What should I do?
    I successfully installed terminal though. Just can’t move that file to the path in iphone.

    Reply
  4. I just come up with an idea of putting that file into the ipa and then after installation I’ll copy that file to the var location. Wish me luck

    Reply
  5. it worked, but when i go ahead and install something from cydia, like activator for example. it falls short because there’s an error telling me that it’s trying to overwrite something.. bla bla mobilesubstrate/dynamic bla bla. something like that. any idea?

    Reply
  6. When i drab the deb into IOS APP SIGNER it does not let me create IPA. It says i was unable to resolve the issue with codesigning?
    any ideas
    thank you!

    Reply
  7. Hey I’ve been trying to do these steps but when I type Su into mobile terminal it’s asks for the password , the password I put in is incorrect , which password are we supposed to be putting in ? Also tried alpine. Still saying wrong password

    Reply
  8. wont work on last part cp: missing destination file operand after /var/mobile/Media/Books/lib/var

    i put the folder lib on ibooks because i cant see the var/mobile 🙁

    Reply
  9. FOR ALL PEOPLE WHO HAVE “missing destination file operand after /var/mobile/Media/Books/lib/var”

    Just unzip the lib.zip to have a lib folder and then, copy this folder to var/mobile/Media/Books

    Just worked for me, awesome 😀

    Reply
  10. I have problem with signing ipa with cydia impactor. Problem with certificate. How can i solve that. And also i dont see place to put lib file in ifunbox
    I have ifile and other but couldnot open just blink and nothing. Plz help me

    Reply
  11. Thank you so much for this. It worked perfectly. The only thing that messed me up was that I screwed up the spacing in the terminal command line on my first attempt–very important!!–second attempt went without any problems whatsoever. This is an easy fix just takes a little figuring out.

    Reply
  12. i got the terminal but i cant type alpine in for some reason i typed “su” then return then password comes up and i cant type a single thing for some reason plz help!!

    Reply
    • Just type the password and enter , for me it was the same issue you can’t see nothing and it seems your not typing but you are good luck

      Reply
  13. in terminal i typed after i type “su” password comes up and i cant type anything ito the space someone help am i typing it wrong?

    Reply
  14. thank you for your great support 🙂 finally in cydia i can get source and repo. but i could not install any of them. there is problem with
    Directory ‘/var/log/apt/’ missing
    and
    sub-process /usr/libexec/cydia/cydo returned an error code (2)
    plz help
    i google it find solution to fixed but need apple file conduit “2” which is impossible with cydia. so i couldnt find var folder in ifunbox. it show my iphone is jailed.

    Reply
    • you need a directory to copy it into, make sure you’re using a space for /var.
      Ex: (cp -R /var/mobile/Media/books/lib) /var
      Whats in the parentheses has to be copied to the /var destination.

      And when seeing returned error codes (1) or (2) its just stating that the script trying to be processed ran into an error. Which can be fixed with Terminal.

      Reply
  15. Ok, I have a solution for all of you having problems;

    When you open cydia and you get the error about the missing lib file, LOOK and take NOTE of where cydia is looking for the lib file.

    Cydia was not looking in /var/mobile/Media/Books for me, it was only looking in /var/”lib”.
    So I just copied lib into var and it worked without using terminal.

    Hope this helps.

    Reply
  16. You sir, are a GOD, thank you for your intelligence i don’t know where i’d be without it in this situation. This is MUCH appreciated 🙂

    Reply
  17. It worked for me! Thanks!!! You saved my jailbreak because people now can´t restore to 9.3.3 so i followed your method and it worked!! Thank you so much!

    Reply
  18. Hi, Worked for my iPhone 6 iOS 9.3..
    I pasted lib folder direcytcly to Books with iFunbox.
    To finish i wrote the command exactly as i’ve been asked to write it (with a space each time there is a space)

    Many thanks TEEAYEAND

    Reply
  19. Your method works.. but now:

    ” ‘trying to overwrite /Library/MobileSubstrate/DynamicLibraries’ which is also in package com.teiron.pphelprns ”

    is the constant error i get whenever i try to install anything in Cydia now… please help

    Reply
  20. Is there anyplace else to get the lib.zip file needed to execute this fix? The link in the tutorial is broken.

    “Error (429)
    This account’s links are generating too much traffic and have been temporarily disabled!”

    🙁

    Reply
  21. Not really good at stuff like this can anyone recommend a video tutorial or step by step as I’m new to this much appreciated if possible

    Reply
  22. if you have ifile do this

    1- delete this file first DynamicLibraries

    /Library/MobileSubstrate/DynamicLibraries

    2- creat new folder and rename to apt on here var/log/apt

    restart your mobile and okkkkkkkkkkkkkkkkkkkk

    Reply
  23. is there supposed to be a space after “cp”? and a space after “/lib” i get these two error messages if i put the space after “cp” i get cp: invalid option — ‘ / ‘
    if i put no space there i get No such file or directory ive tried copying straight to the iBooks ive tried straight to Books ive even read every single comment to see if i can find a solution but nothing is working.

    Reply
  24. I can’t find var on ifunbox, if I drag and drop Lib to iBooks instead what do I have to type into MobileTerminal to fix the database error?

    Reply
  25. Deleted cydia application through the ifile (I spotted all had cydia the name and blacked out) and now I can not install through the jailbreak cydia again what to do? I have remade the jailbreak process in ios 9.3.3 I get the msg saying that the phone is jailbreakon but cydia not appear. Some applications are still functional as Filza Gamegen Flex but nothing cydia.

    Reply
  26. Most are getting stuck in the MobileTerminal portion. if you have everything right up to this point, the main issue is going to be typing the command correctly…. there is a “space” after “cp”, “-R”, and “lib”
    cp -R /var/mobile/Media/Books/lib /var

    if you have the correct space inserted, this should work.
    THANKS for the original post! helped me, and it WORKS!

    Reply
  27. Thank you sooo much<3 You saved my life !!! FOR EVERYONE GETTING STUCK AT THE LAST STEP:
    There is a space after the cp, the -R, and the lib portion.
    This helped me! Hope it helps!

    Reply
  28. is the var/media/books in the general storage system or is it in the raw file system. my iphone is jailbroken but it wont let me access raw system because it keeps saying its not jailbroken. ifun wont let me put mobile terminal in the cydia impactor either. any help would be awesome. thanks 🙂

    Reply
  29. well i got the books to work now the only issue im having is the info.plst folder. wont install mobile terminal on it. is it becaue my device isnt jailbroken? it is but it say its not

    Reply
  30. thank you! worked for me.. i kept messing up in the mobile terminal entering.. remember there is a space before you start to type in anything

    Reply
  31. cp -R /var/mobile/Media/Books/lib /var

    here is the actual working code, make sure you follow it right to a to including spaces and the – between cp and r , there is one space then a ” – ” .

    Reply
  32. My phone is jailbroken on 9.3.3 using the Pangu jailbreak. I was able to load the mobile terminal by pasting the zip file into the “Books” folder. I signed in using su and alpine and get the promt “iphone:/var/mobile root#”, but when I type in cp -R /var/mobile/Media/Books/lib /var I get an error
    “cp: cannot stat ‘/var/mobile/Media/Books/lib’ no such file or directory”
    I am using iFunbox and can’t get into the raw file system, only the user file system. Does anyone have a suggestion on a fix?

    Reply
        • I’ve been using that code and I still get the same error. I’ve re-entered it again several times and checked for errors but can’t get it to work. Would placing the zip file into the books folder be causing any issues? I wasn’t able to copy the whole folder to put into books, it kept opening the sub folders on me so I out in the zipped file. Any other ideas if that is ok?

          Thank you

          Reply
            • Thanks Paul, swear I tried that several times before but it worked this time.

              Now the code didn’t put up an error, but just went back to iphone: /var/mobile root#
              I closed terminal and tried cydia again but got the same errors. I went through the steps again and put in mkdir /var/log/apt as suggested but it said that the file already exists.

              I tried to then go to cydia/installed apps but couldn’t find it in iFunbox and can’t see any installed apps when I open cydia.

              Any suggestions? Thanks

              Reply