Islam Adel
Architect & IT Expert

اختر لغتك

Somehow I damaged the file which contains the installed cydia apps on my iphone
File path: /var/lib/dpkg/status
I tried to recover it on my own way. This steps may take long but anyhow it worked for me!

In the File you will have to enter the packages as this example:

Package: x
Status: install ok installed
Version: x
Pre-Depends: x
Depends: x
Conflicts: y
Replaces: x
Installed-Size: 1

For cydia for example:

Package: cydia
Status: install ok installed
Version: 1.0.3044-65
Installed-Size: 1448
Pre-Depends: dpkg (>= 1.14.25-8)
Depends: apr-lib, apt7-key, apt7-lib, darwintools, pcre, shell-cmds, system-cmds, essential
Conflicts: com.sosiphone.addcydia
Replaces: com.sosiphone.addcydia

The fields mentioned above are the only (till now) required fields, ignore all others like maintainer, description, etc.

To know which packages you already installed browse to /var/lib/dpkg/info and grab all *.list names
for the example mentioned above, you would find a file called cydia.list

get required infos of packages from iphone:

/var/lib/apt/lists/ *Packages

or  from internet:
Here are infos about the fields from some repos:
(found by searching google : "Package: package-name" and don't forget "quotation marks"

http://modmyi.com/cydia/search.php

http://apt.saurik.com/dists/tangelo-3.7/main/binary-iphoneos-arm/Packages
http://apt.modmyi.com/dists/stable/main/binary-iphoneos-arm/Packages
http://apt.bigboss.us.com/repofiles/cydia/dists/stable/main/binary-iphoneos-arm/Packages
http://iphone.tgbus.com/cydia/Packages
http://repo.beyouriphone.com/Packages

 

Batch Script placed in the folder of status with info foldercontaining *.list is inside
This will restore all to new file status-append
then just copy and paste to status, open cydia and correct version, dependencies, etc.

@echo off
Title Restore Installed Apps
ECHO.
ECho append *.list to status
ECHO.
for /f %%i in ('dir /b info\*.list') DO (
    CALL :schonda %%~ni
)
ECHO.
ECHO Done!
pause
exit

:schonda
SET F=status-append
FIND "Package: %1" "status"
IF NOT %ERRORLEVEL%==0 (
    ECHO     [%1]    [Missing!]
    >>%F% ECHO.
    >>%F% ECHO Package: %1
    >>%F% ECHO Status: install ok installed
    >>%F% ECHO Version: 1
    REM >>%F% ECHO Pre-Depends: x
    REM >>%F% ECHO Depends: x
    REM >>%F% ECHO Conflicts: y
    REM >>%F% ECHO Replaces: x
    REM >>%F% ECHO Installed-Size: 1
    ) ELSE (
        ECHO     [%1]    [OK]
    )
GOTO :EOF