Tuesday, January 4, 2011

How to fix a bad/corrupt/hidden source in Cydia

I was adding a new Cydia repository the other day to my iPhone and apparently mistyped something. I deleted it from the GUI, but every time I went to search Cydia for an application or manage my source list, I received an error that the repository was unavailable and then received the following error:

Sub-process bzip2 returned an error code (2)

Fortunately, there's a way to fix it. You'll need a few pieces of software:

  1. Make sure you have SSH access to your iDevice When you installed Cydia, you had the option for which tool sets you wanted. If you didnt' select a tool set that includes command-line tools, you'll need to install those first (OpenSSH is the main piece that's required). If SSH isn't working, you'll need to reinstall it and then respring your device.
  2. Test your SSH login credentials by using an SSH client such as putty connecting to your device's WiFi address and logging in as 'root.' If you have not changed the root password, the default is 'alpine.'
  3. Using a secure copy client (such as WinSCP), connect to your iDevice and navigate to /private/etc/apt/source.list.d.
  4. Right-click > Edit the cydia.list file, remove the offending line, and click Save. Close the WinSCP editor.
  5. Navigate to /private/var/lib/cydia.
  6. Copy the metadata.plist file to your computer.
  7. Using plist editor, open the metadata.plist on your computer.
  8. Search for the repository you need to remove. The line will look something like deb:http://repositoryname/:./
  9. Select and delete down to the next key tag. Your selection should start with an open key tag and end with a close dict tag and should contain approximately 9 lines of data.
  10. Copy it back to /private/var/lib/cydia and overwrite the existing file.
  11. Navigate to /private/var/lib/apt/lists and delete the files starting with the name of the source you wish to remove.
  12. Navigate to /private/var/lib/apt/list/partial and do the same.
  13. Close WinSCP and respring your iDevice.

No comments:

Post a Comment