Upgraded my iPhone4 from 5.0.1 to 5.1.1, used Absinthe 2.0.4 to jailbreak, used PkgBackup to re-install all my cydia tweaks. Some tweaks remained uninstalled so I went back to PkgBackup and restored them but still cannot do so. Tried to install them directly from Cydia but got this:

Error messages:

subprocess dpkg-deb --fsys-tarfile returned error exit status 2

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

Tried to restore & re-jailbreak but same problem pops up. This happens for installing/upgrading.

Tried the following but with no use:

1- Get your way to the file and directory structure of your iPhone (through SSH or iFile or Mobile Terminal ...)

2- Look for the /var/lib/dpkg/ directory

3- You should be able to find the following files: available, availble-old, status, status-old

4- Rename "available" to "available-bak"

5- Rename "status" to "status-bak"

6- Rename "available-old" to "available"

7- Rename "status-old" to "status"8- Start Cydia , make sure that you allow Cydia to load completely first (just to be on the safe side ), try to install some apps. Start Cydia , make sure that you allow Cydia to load completely first (just to be on the safe side ), try to install some apps. a , make sure that you allow Cydia to load completely first (just to be on the safe side ), try to install some apps.

The question has been closed for being "Other - old" by
theiphoneguy,
15 Dec '13, 21:57

If this problem still happens after rejailbreaking, it would have to be a problem with the actual PkgBackup download, not your device. Try downloading over 3G to make sure there aren't any proxies blocking the download. If it still happens, you should notify the developer through the "Author" link on PkgBackup's page in Cydia.

According to google results for your error message, running the command sudo apt-get clean should help with this (and if it doesn't help, it's harmless anyway). If you run into this problem again, try it out and let us know what happens. Cydia should pretty much run that command automatically, but maybe it isn't working correctly for some reason.

(In other words, if you're getting that error but can still install some packages, try installing MobileTerminal via Cydia, and then type that command into MobileTerminal. It'll request your device's root password, which is "alpine" by default.)