[Tutorial] fix “Erase all content & settings” Cydia /var/lib/dpkg/status error

Cydia Errors when you "Erase all content & settings"

Ok, here we go… This is for people who are getting "Could not open file /var/lib/dpkg/status – open (2: No such file or directory)" error messages in Cydia, after using mentioned function in ‘Settings’ and have neither iFile/Filza, nor MobileTerminal installed. For people, who have any of those up and running

It requires a computer. You need to be running jailbroken.
1… Download the NewTerm (MobileTerminal) deb file from here: https://cdn.hbang.ws/dl/debs/ws.hbang.newterm_1.0~beta1_iphoneos-arm.deb
2… Mac users can use iOS App signer to create an ipa out of the deb. https://dantheman827.github.io/ios-app-signer/
Windows users can take a look here and do it like below: https://www.youtube.com/watch?v=4CEWnN_z5DI

  • Unarchive the ‘ws.hbang.newterm_1.0-beta1_iphoneos-arm.deb’
  • Unarchive the resulting ‘data.tar.lzma’. This will leave you with a folder named ‘Applications’ and a ‘MobileTerminal.app’ in that folder.
  • Rename the folder ‘Applications’ to ‘Payload’.
  • Zip the folder ‘Payload’ and rename the file from ‘Payload.zip’ to ‘MobileTerminal.ipa’

3… Download & Install Cydia Impactor: Cydia Impactor

  • Sideload the ‘MobileTerminal.ipa’ with Impactor like so.

4… Download iFunbox from here and install it: iFunbox | the File and App Management Tool for iPhone, iPad & iPod Touch.
5… Download the ‘lib.zip’ from here: lib and extract the containing ‘lib’ folder to your computer.
6… Drag/Paste the ‘lib’ folder into ‘iBooks’ (top level) in iFunbox (fyi, it will land in: /var/mobile/Media/Books). You won’t need root access (AFC 2) to do this.
7… Open MobileTerminal now. Type it exactly how it’s written!

  • Type: su
  • Type in your password, in order to get root access, default is: alpine
  • Type: cp -R /var/mobile/Media/Books/lib /var

7b.. ONLY if you are getting ‘missing var/log/apt’ errors:

  • Type: su and password (if you closed Terminal before)
  • Type: mkdir /var/log/apt

8… Install a simple tweak in Cydia (it doesn’t matter which one, but iCleaner is a good choice), in order to create the directory: /var/stash
Alternatively, you can also use Terminal to do it:

  • Type: su and password (if you closed Terminal before)
  • Type: mkdir /var/stash

8b.. ONLY if you have the PP Helper in Cydia (the Chinese store, com.teiron.pphelperns). Uninstall it.
9… Install ‘Cydia Eraser’ in Cydia.
This is optional, if things still don’t work properly and/or you (rather) want to clean your device and start jailbreaking from anew.

10… If you want to make sure and have installed a lot of tweaks: Open iCleaner (install it, if you haven’t), in order to see how much space you have left in: / (top line). 50MB should be enough for most scenarios. Otherwise… Cydia Eraser might fail. (If you deleted other languages with iCleaner at an earlier stage, do not, I repeat: do not use Cydia Eraser. It will fail! Same thing goes for manually enabled stashing, although that’s fixable. Also, put your system font and screen resolution back to default, if you changed it.)

11… Uninstall ‘Cydia Substrate’ as a last step in Cydia, before you:

12… Run Cydia Eraser.

13… And people, do yourself a favor and install Apple File Conduit "2" and Filza/iFile (or at least Terminal) afterwards – I personally prefer Filza! I know, that some of you probably think file managers are for old people or sth. – but how come, that we "old" people usually don’t get ourselves into this kinda trouble ;)?

P.S. Users, who have a running version of Terminal, can start with step 4…
P.P.S. Users that have a running version of iFile/Filza, can also start with step 4… and then copy the ‘lib’ folder from /var/mobile/Media/Books/ to /var/ for step 7…

Credits Goes to reddit