I have ultrasn0w installed strictly to fix the one signal strength bar issue on my ip4 (on AT&T with 4.3.3 & 1.59.00 bb) and I frequently run into problems with it when one of my Cydia apps needs updating. When I try to update an app(s), ultrasn0w gets reinstalled even though it's already installed and not in the queue. When that happens I get an error that says "Sub-process /usr/bin/dpkg returned an error code (2)". Sometimes when I go to update an app I get the same error message without the ultrasn0w reinstall happening.

I did some research and thought I found a fix, which was the following:

Solution:
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.

I've fixed this problem several times now but it keeps coming back. I'm not sure if it's related to ultrasn0w or not but it seems like ultrasn0w might be stuck in the queue or something. I don't know if I need to do a complete reinstall of Cydia or if there's a way to just rebuild the Cydia databases but I don't know what to do at this point. It seems like every time I try to update an app or something this error comes back and it's the same error every time. Is there an easy way for me to uninstall Cydia and then reinstall it without having to re-jb and start over? I'm so desperate at this point.

The problem with that is that I can't install, reinstall or remove anything in Cydia right now due to the error I'm receiving (the one in my original post). And I can't even "fix" it in ifile right now because the available-old and status-old files are missing.

You need to find a way to get your mobile terminal back because you can perform a force installation via terminal. Try downloading from this site http://code.google.com/p/mobileterminal/downloads/list, either drop it to Cydia App Install "/var/root/Media/Cydia/AutoInstall" or use iFile to install, and then reboot iPhone.

No matter what I try to do, it seems like I run into a roadblock. I copied the deb file to the directory you specified (I had to create that directory though because it did not exist on my phone already), rebooted, ran Cydia and nothing. Then I tried to install it manually via ifile and got the following message:

Use iFunbox navigating to this "/var/lib/dkpg/" directory, copy that status file to your desktop, open status file with notepad or notepad++, go to line 1940 and post that line here. And I found error code 512 via Google is related to permission issue but I could be wrong too.

I decided to try re-jailbreaking my phone because I'm having way too many problems with it. If I continue to have this same problem after I'm done setting everything up again, I'll post back here to try to get some more help. Thank you so much for your time!!!

i have this problem, i have rebooted my device, i have done the iFile shit, i have removed sketchy repos and still have this damn problem. is their anyway too fix it i really do not want to restore and this is annoying as a tick on a hound dog with a stiff neck