Ever since the beginning of Cydia, iOS Jailbreaks always relied on DPKG (Debian Package Manager) in order to install tweaks. To this day, iOS jailbreak tweaks come in the .DEB format which is handled by DPKG in the background.
In fact, you don’t even need Cydia to download and install tweaks on a jailbroken iOS device. If you have the .DEB file containing the tweak, and access to a terminal or SSH, a simple
dpkg -i file.deb would install the tweak without any issues.
Cydia itself doesn’t do much other than download the DEB file from the appropriate repo and call DPKG in the background. Cydia is a GUI application for APT and DPKG, and nothing more. In this case, whenever an error occurs while installing a package, it’s usually DPKG that complains rather than Cydia, Sileo, or Zebra.
What does DPKG_LOCKED mean?
The DPKG_LOCKED usually means DPKG failed to install a package but was abruptly stopped or it crashed. When installing a package, DPKG puts a lock file somewhere in the file system (either /var/lib/dpkg, or /Library/lib/dpkg). This way if another process tries to spawn DPKG and install another DEB file while DPKG is busy, that process will just get an error message because DPKG is currently locked doing something else.
Unfortunately, if for some reason your device crashes, reboots, or simply kills DPKG right in the middle of installing a tweak, DPKG doesn’t get to finish the installation and clear the lock file from the file system. This results in DPKG remaining permanently locked and thus not allowing any tweak to be installed again.
The fix is rather simple if you have any of the following three options:
- Can SSH into the device (Dropbear or OpenSSH already installed).
- Have Filza File Manager installed.
- Have NewTerm or any other mobile terminal tweak installed.
How to fix DPKG_LOCKED error in Cydia / Sileo / Zebra on iOS Jailbreaks
Method 1: Via PC SSH or Mobile Terminal / NewTerm 2
In order to fix DPKG_LOCKED via SSH, all you have to do is to follow the steps below, one by one:
- SSH into your device as root. The default password is alpine if you never changed it. Make sure your PC and your phone are on the same WiFi.
- Run the following command: cd /var/lib/dpkg OR cd /Library/lib/dpkg if the other one says No such file or directory.
- Run the following command: rm lock
- Go in Cydia and refresh all packages / repos.
- Your issue should be fixed.
Method 2: Via Filza File Manager
If you already have Filza installed, you can fix this issue much easier because it’s all visual, with no commands and SSH involved.
- Open Filza.
- Navigate to either /var/lib/dpkg OR /Library/lib/dpkg folder (whichever exists for you).
- Inside the DPKG folder, find the “lock” file and simply delete it.
- Open Cydia and refresh all packages and repos.
- The error should be fixed.
That’s all, it’s that simple to fix the DPKG_LOCKED issue on any jailbreak. We’ve also put together a video tutorial if you want to check it out. Even though it was made on iOS 11, it applies to ANY jailbreak.
Other guides from iDevice Central
- iOS 15.0 – 15.1.1 Cheyote Jailbreak Was Announced by the Odyssey Team
- Why CheckRa1n Jailbreak Doesn’t Work on iOS 15 and Will it Ever Work Again?
- How To Run Linux on iPhone / iPad & How They Achieved This
- iOS 15.0 – 15.4 Jailbreak News: Latest Progress & New Techniques
- Unpatchable Apple M1 Chip Vulnerability discovered by MIT
- How to create a bootable Windows 10 USB Flash Drive on Mac
- iOS Jailbreak Downloads – Download Jailbreak Tools for All iOS Versions
Warning icons created by amonrat rungreangfangsai – Flaticon