Even though a lot of users have finally managed to jailbreak their iPhones, Cydia has started throwing errors left and right. Here’s a quick fix for the DPKG_LOCKED Cydia and cydo returned an error code errors on iOS 11.
Table of Contents
Why does Cydia throw the DPKG_LOCKED/cydo returned an error code error?
Cydia throws the DPKG_LOCKED and cydo returned an error code messages on a number of occasions, namely –
- Cydia not installed properly on your iPhone or iPad.
- Cydia installation getting corrupt.
- Jailbreak uses a bogus or outdated version of the Cydia package manager.
- User error.
Thankfully enough, the good old Delectra script still works for Electra1131 even though the developer didn’t update it.
You can easily use this script to clean your Cydia installation and then jailbreak your device again from scratch.
- iPhone, iPad, or iPod touch
- iOS 11.2-11.3.1 firmware
- Wifi connectivity
- Delectra uninstall script
- A computer running Windows or macOS
- Wifi network
Fix DPKG_LOCKED and cydo returned an error code on iOS 11.2-11.3.1 with Delectra
Prepare your device
Step 1 First and foremost, ensure your device is in jailbreak mode. If it isn’t, re-jailbreak your device by following this guide.
Step 2 Download Cyberduck for macOS or Windows from here.
Step 3 Download the Delectra shell script (unjailbreak.sh) from this link.
Step 4 Open the Settings app on your Apple device, go to Wi-Fi and tap the “i” icon present alongside your Wifi network you are connected to. Note down the IP Address value as we will be using it in the subsequent steps.
In our case, the IP address is 192.168.1.100.
Transfer the uninstall script to your device
Step 5 Launch CyberDuck SSH utility and click on Open Connection.
We will demonstrate this process using macOS Mojave but you can perform all steps on Windows as well.
Step 6 Select SFTP (SSH File Transfer Protocol) from the protocol dropdown list. If you set it to any other option, you will not be able to establish an SFTP connection.
Step 7 Enter the following details to establish an SFTP session –
- Server – Your Wifi network’s IP address you noted in step 4 above.
- Username – root
- Password – alpine (default password)
- SSH Private Key – None (default)
Step 8 Cyberduck will now warn you about an “unknown fingerprint”. Click Allow to move on to the next step.
Step 9 Transfer the unjailbreak.sh shell script to the /private/var/root folder by dragging it onto Cyberduck’s window.
Remember, this is the default folder and contains only two sub-folders (Application Support and Library) and a file (files.list).
Execute Delectra script
Step 10 On your Mac, close Cyberduck and go to Go > Utilities. If you are on Windows, you must use PuTTY telnet client that you can download from this link.
Step 11 Open the Terminal app.
Step 12 You would now want to log in to your device as root. Enter the following commands –
ssh root@<IP Address noted in step 4>
Step 13 Terminal will now warn you about the authenticity of the host and will ask you to continue or abort the session. Type in yes to continue.
Step 14 Type alpine in the “password:” field and wait for it to log you in. Remember, you must use your custom password if you modified it before.
Step 15 Type the following command and hit enter/return key to execute it.
Jailbreak your device
Step 16 Once the script removes jailbreak from your device, it will go back to its original stock firmware version. Restart and jailbreak your iPhone/iPad using Electra1131.
That’s all there’s to it! You will now be able to install your favorite Cydia tweaks without DPKG_LOCKED and cydo returned an error code messages pestering you.