JailbreakTips & How-to

How To Backup and Restore Cydia Application Before iPhone Upgrade

February 11, 2010 — by Simon Ng40


JailbreakTips & How-to

How To Backup and Restore Cydia Application Before iPhone Upgrade

February 11, 2010 — by Simon Ng40

iPhone Cydia BackupEvery time you upgrade a jailbroken iPhone to a new version of firmware (or iPhone OS), as you know, it is required to go through the whole jailbreak process again. That means, all your iPhone applications and Cydia applications are completely removed. For iPhone applications, you can back them up by syncing via iTunes. But how about those cydia applications? iTunes will not take care this kind of applications. So, how can you backup these apps and restore them after iPhone upgrade?

One way is to use AptBackup, which is available on cydia. The way how AptBackup works is that it saves a list of Cydia-installed applications, backup the list via iTunes and restore the list back to your iPhone. Later, cydia can refer to that list and install all the applications again. I have covered this app very long time ago and you can check out the review here.

As reported by some users, however, they just can’t get AptBackup work. Today, I am going to show you a manual way to backup and restore cydia applications. If AptBackup doesn’t work for you, you can use this manual approach to backup and restore the applications.

The manual approach requires you know about SSH or DiskAid. At least, you need to know how you can transfer file between iPhone and computer. To learn more about it, you can refer to this post of How to Use SSH to Transfer File on iPhone.

Okay, here we go.

Backup Cydia Application

1. First, make sure you have installed OpenSSH, MobileTerminal and Gawk on your jailbroken iPhone. All these packages can be found on cydia if you miss any of them.

2. Launch Terminal app.

3. In terminal, type “su” and followed by the root password. Please note your password will not be echoed. If you haven’t changed the root password, just key in “alpine” and tap return.

4. Then type dpkg -l | grep ^ii | awk '{print $2}' > /var/root/cydiabkup.txt and then tap return key.

5. After you execute the command, it automatically retrieves the list of cydia applications installed on your iPhone and saves it into the cydiabkup.txt.

6. Next, transfer /var/root/cydiabkup.txt from iPhone to your computer using SSH or Diskaid. To let you have an idea of the backup file, here is how the file looks like:

The file just contains a list of cydia of applications you have installed. Later, you will need to use the file again after iPhone upgrade.

Once the cydiabkup.txt is copied to your computer, it is safe to upgrade your iPhone and jailbreak it again.

Restore Cydia Applications after iPhone Upgrade

Okay, now you have completed the iPhone upgrade and I assume you have already jailbroken the iPhone again with cydia installed.

1. Before you can restore the cydia applications, make sure you install OpenSSH, MobileTerminal, Gawk and APT 0.7 Strict packages from cydia. These packages are used during restoration process.

Note: Before you move on, make sure you disable Auto-Lock. You can go to Settings -> General -> Auto-Lock and tap “Never”.

2. Download install-cydia-app.zip and unzip it

3. By using SSH or Diskaid, transfer both “cydiabkup.txt” (the file that you have generated in the backup process) and “install-cydia-app.sh” (the file you just unzip in step 2) to your iPhone under /var/root folder.

4. Launch Terminal app and type “su” to logon as root. Same as before, use “alpine” as password.

5. Next, type sh /var/root/install-cydia-app.sh and tap return key.

6. After running the command, it will automatically download the cydia applications and install them accordingly. When prompt “After this operation, xxMB of additional disk space will be used. Do you want to continue [Y/n]?“, simply key in “Y” and tap return. Depending on the number of cydia apps to install, the process may take five to ten minutes.

7. Once the installation completes, restart your iPhone and all cydia apps should be restored.


Thing normally goes straightforward. But it’s not uncommon you may encounter some hiccups. If you experience errors like Couldn't find package xxxx, that means the cydia application is no longer available for download. What you have to do is to edit the “cydiabkup.txt” on your computer and delete those obsolete packages. Afterwards, transfer the updated “cydiabkup.txt” back to your iPhone and continue with step 4 again.

As always, should you have any questions, please feel free to leave me comment below. If you find other ways to backup and restore cydia apps, feel free to share it with us.

Simon Ng

Founder, developer and chief blogger of simonblog.com

  • Spamdumpster

    Here’s an easier way. Prior to updating, run this command: dpkg –get-selections > myapps.txt. Then backup the myapps.txt file to your mac or pc and restore your firmware.

    Once restored, install the cydia packages you indicated, then SSH and run the following commands in order

    dpkg –set-selections < myapps.txt
    apt-get -u dselect-upgrade
    rm /private/var/mobile/Library/Caches/com.apple.mobile.installation.plist
    killall SpringBoard

    • @spamdumpster,

      Great Tip! Thanks a lot.

    • FuRrY321

      Well… crap. Spamdumpster, I realize that your post was over a year ago, but this method didn’t work, and now I’ve lost all my Cydia apps.

      What this did was backup all the default stuff that came with Cydia (read: the core files, sources, packages, etc.) but it didn’t list any of the things I had personally installed. My own fault really, for not checking the .txt more thoroughly, but I saw text, figured since something actually APPEARED then by golly it must work! Then I proceeded with the restore, just to learn that – well s***.

    • Dave

      So I backed up my iphone in itunes.Is there a way to reinstall the apps from there?How do I identify the app in the backup location?

  • RJ

    Here is an even easier way: install Rock on your iPhone and create a Rock account with only your email and a password. Rock gonna save the 5 latest stage of your JB apps and you can restore any time. Saved me hours and hours of search and install last time when I upgraded to 3.1.2.
    Just my 2 cents.

  • Pingback: How to Backup and Restore Your Jailbreak Apps | How to Unlock()

  • Samson

    Beside the applications, isn’t it possible to create a FULL backup of the complete iPhone3GS/iPod Touch3 root partition to the user data partition? I am just thinking since Apple is no longer allow recover to OS 3.1.2 if we can at least create a tarball of the whole existing OS then we can just simply restore the full system just in case things being messed up..

  • EMale1965

    I have tried this procedure and when I open the cydiabkup.txt file it is empty. I have done this several times. What am I doing wrong? I should also say that before the Terminal goes back to the var/mobile root# command it shows a list of other commands and options and then produces the var/mobile root# command. It also says: “Options marked [*] produce a lot of output – pipe it through ‘less’ or ‘more’ !” What does this mean and how do I get this to work? I am using a jailbroken 32GB iPhone 3GS with firmware 3.1.2. Any help would be appreciated. It is a real pain to re-install all the Cydia apps after a restore.

  • dzoi

    how about apps installed via installous? is there a way to create a backup for that?

    • Sal

      You don’t need to backup apps from Installous. They should stay on your idevice even after updating your iPod. However, you won’t be able to open them until you rejailbreak and install Installous.

    • you can visit http://www.devicera.com and there its shown how to backup your installous downloaded .isp files

  • SErgio

    I getting the followin error:
    Oprtions marked [*] produce a lot of output – pipe it through ‘less’ or ‘more’ !

    Can you please advise?

  • Pingback: How Backups and Restore your Jailbreak Apps | Tutorials, Tips and How to's()

  • Salud

    Its not working for me, every time i write the code i get “dpgk: unknown option -1”

    • Eric

      You are type dash one, the command is dash “ell” as in L instead of 1 but the L is lower-case.

  • Ed

    The most common mistake is to use a single leading hyphen (-) for options to the dpkg command. Be sure to use two leading hyphens (–) and things should work for you.

  • Matine

    Hi all

    1- How to get Gawk ?
    2- I can intall MobileTerminal but can’t open, How ?

    my iphone :
    Firmware : 05.13.04
    Version : 4.1 (8B117)

    • ash

      Some of this is out of date. I dint think Mobile Terminal works on iOS 4.0+ at all.

  • Fabio Gangarossa

    Excellent article, the procedure works perfectly, however I believe you should mention that you must re-insert the Cydia repositories manually for things to work smoothly.

    Thanks again!

  • Pingback: iPhone Hack: How to Backup & Restore Your Jailbreak Apps | iPhone Hacks - Guide for Jailbreaking your iPhone 4, iPhone 3gs and iPhone 3g()

  • Moe

    Yes exactly Fabio – very important step that you have to take note of the repos where you installed your apps from and write them down and then before you can run the restore commands you first have to MANUALLY ADD those REPOS back to Cydia else the commands will run and not find the repo, and hence not find the app you had.

  • Pingback: Backing Up Your Cydia Packages | How's My App()

  • chikanoz

    hi simon. i cant seem to install “gawk” from cydia. app not found. is it on a different repo?
    also my mobile terminal crash each time i launch. hmm.. can u help?

  • This would work GREAT if only the restore process, well, actually worked. I’m getting an error with the .sh file on line 4. no clue wtf to do now. -Had over 100 packages from cydia-
    iPod Touch 4G
    Firmware 4.3.1
    Redsn0w 0.9.6rc9 untether

    • Fabio Gangarossa

      This method DOES work! Perhaps you could tell us what error you are getting? Did you remember to enter your Cydia repos manually BEFORE you run the script?

  • Naitch

    Hi I keep getting the error that it couldn’t find the package. But if I got into cydia and search for the item I can find it and install manually. I’v added all the sources I had before so that shouldnt’ be the problem. Thanks in advance!

  • Pingback: manually backup cydia apps and ssettings()

  • ColdGlueGun

    Yea…I made sure I has all the dependencies to run this. I entered allof my cydia repos. The mobile terminal process went perfectly but then when i turned off my ipod then back on, the only thing that was installed was installous. NONE of my other cydia apps were there! NONE were installed. Any Ideas? Please.


  • schirin

    Hi guys, i’m getting error “awk: command not found”.

    I can’t find Gawk in cydia. is there another source i need to add to find Gawk?

    Simon, can you update your instructions for 4.3.2?

    • @schirin,

      Thanks. The guide has been written base on earlier version of iOS. I’ll test it with the latest version of iOS soon.

  • mago

    he is here http://www.cydia-iphone.fr/ work fine for me

  • Tom

    What if the user has not done a backup?
    recover photos from iphone

  • NEO

    Mistake delete file var lib apt list on iphone 4 how to recovery back i dont have any backup

  • You are great

    Thank you so much because of this I was able to update my ipod to 5.01 and still get my cydia apps back. THANK YOU \(^-^)/

  • hamzah

    i have tried this and the backup process worked perfectly. i restored to the same firmware as it was before (5.0.1) and typed in the command
    sh /var/root/install-cydia-app.sh
    it said install:target “winterboard” is not a directory

  • Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my
    blog that automatically tweet my newest twitter
    updates. I’ve been looking for a plug-in like this for quite some time and was hoping
    maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.