If you need to restore your iOS device, you can use this app to generate a script to restore every package previously installed. You will need the file aptlist.txt created with the script iplcreatorbypedro.sh.
Then, you only need to run : ./aptrestore.sh
Make sure your device has enough charge and the internet is working properly.
All done. Have fun!