Thursday, October 28, 2010

Can’t Run APT-GET from SSH/MobileTerminal? Try this

After jailbreaking for 4.1, many of you will notice you can no longer run apt-get commands from the command line, whether SSH or MobileTerminal. This is mind boggling, and none of the support sites or forums seem to have the right answer. The most common suggested solution is to delete some sources from Cydia and re-add them. This doesn’t work.

After a few hours of troubleshooting, I gave up and assumed it was a limitation of shit greenpois0n. However, today I accidentally found the answer, and it’s quite simple to make this work again.
The root of the problem is pretty simple. You didn’t install EVERYTHING that you had installed on your previous jailbreak. I personally don’t use APTBackup for restoring jailbreak apps after major iOS updates, since it sometimes installs incompatible apps that render my iDevice unstable. The solution is just as simple.
Install CyDelete from Cydia. While it was installing, I noticed a bunch of apt-related dependencies being installed and my lightbulb went off. CyDelete uses apt and dkpg commands to uninstall jailbreak apps. It probably uses the same commands that I would from its own command line. I was right. I immediately tested out apt-get via the command line after my iDevice respringed, and sure enough it worked!
Anyone else get this problem? Sound off if this helps.