A lot of people have managed to jailbreak their iDevices, but still Cydia continues to throw errors at them, right and left. This article reveals a solution for the DPKG LOCKED cydo and Cydia returned an error code issue on iOS 11.3.1 – 11.0 jailbreak.

fix dpkg locked error

Why Does Cydia Give DPKG LOCKED/CYDO RETURNED AN ERROR CODE Issue?

Cydia gives the “DPKG_LOCKED” & “cydo returned an error code” messages on several occasions, when –

  • Cydia installation is corrupted.
  • Cydia isn’t properly installed on an iDevice.
  • There’s an error on part of the user.
  • Jailbreak is using an outdated or bogus version of the package manager of Cydia.

Fortunately, though, the old tested Delectra script still functions for Electra1131 even though it hasn’t been updated by the developer.

The script can be easily used to clean Cydia installations and jailbreak the device from ground up again.

What You’ll Need

  • WiFi connection.
  • iOS 11.2-11.3.1 firmware.
  • iDevice (iPod, iPad, or iPhone).
  • Uninstall script for Delectra.
  • WiFi network.
  • PC running macOS or Windows.

Steps to Fixing DPKG_LOCKED ON IOS 11.3.1 – 11.0 & Cydia Returned an Error Code With Delectra

PREPARING YOUR DEVICE:

  1. Before anything else, make sure you’re in jailbreak mode. If your device isn’t jailbroken, follow this guide to jailbreak it.
  2. Download Cyberduck or Putty for Windows or macOS.
  3. Download (unjailbreak.sh) – the Delectra shell script – from here.
  4. Launch Settings from your iDevice, go to “WiFi” and tap “i” alongside the WiFi network you’re connected with. Note down “IP Address” as this is going to be used in later steps.

fix dpkg locked cydia

The IP will be something like: 192.168.31.180

Transferring The Uninstall Script to Your iDevice

  1. Open CyberDuck SSH utility and click “Open Connection”. We will be showcasing this process with macOS Mojave but all the steps can be performed on Windows too.
  2. Choose “SFTP (SSH File Transfer Protocol) from the protocol dropdown list. If it is set to any other option, an SFTP connection won’t be created.
  3. Enter these details to launch a session for SFTP.

Server – The IP address of the WiFi network as noted in step 4.

  • Username is going to be root.
  • Password – default one (alpine)
  • SSH Private Key – default (None)

dpkg locked cydo fix

  1. Cyberduck will now showcase a warning for an “unknown fingerprint.” Click “Allow” to go to the next step.
  2. Transfer “unjailbreak.sh” shell script to the folder “/private/var/root” by dragging it to the window of Cyberduck.

Please note that this is the default folder and includes only two sub-folders (Library and Application Support) and a file (known as files.list).

Launch Delectra Script

  1. On the Mac, close down Cyberduck and head to “Go > Utilites’? If you’re using Windows, you must utilize “PuTTY” talent client that can be downloaded from this link.
  2. Open “Terminal” app.
  3. You should now log in to the device as root, and enter these commands:

ssh root@192.168.31.180

Note: Instead of 192.168.31.180 enter your IP from Step 4.

dpkg_locked ios 11

  1. Terminal will now display a warning about the host’s authenticity and will request you to abort session. Type “yes” to proceed.
  2. Type “alpine” as the password and wait until it logs you in. Remember to use the custom password if you modified it before.
  3. Type this command and press “enter/return” key to launch it.

Bash .unjailbreak.sh

Jailbreak The Device Again

  1. Onnce the script has eliminated jailbreak from the device, it will return to its normal stock version. Restart the device and use Electra1131 to re-jailbreak your iPhone.

dpkg locked error fix

And that’s all. You can now install your favorite tweaks from Cydia without seeing cydo returned an error or DPKG_LOCKED messages.