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.
Requirements
- 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 [email protected]<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.
bash ./unjailbreak.sh
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.
i don`t have wifi to connect to my iphone, is it possible to connect with hotspot ?
Yes, you can use hotspot.
Thanks very much, it worked!
Didn’t need putty, just used terminal on my Windows10
That’s great, Steve. Glad it worked.
I keep receiving a “No such file or directory” in putty when i run step 15. Help Please
Can you please post a screenshot?
i forgot my old password on ssh [email protected]<IP Address
access denied
Go to /private/etc/master.passwd file and change the line for root password to this – root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh
Can you explain me this please? I’d never changed my password, i already did this once and was ok, but now i need to do it again and it says access denied but password is alpine because in cyberduck it grants me access, just putty doesnt.
That’s weird. If you don’t change the password, it stays “alpine”. Were you able to fix the error though?
hi . when i want to use PuTTY in windows . it’s getting error / Connection refused / what should id do ? i type : ssh [email protected]
is this necessary to install openssh and openssl on device ? because i can’t user cydia for install them
how can i open port in my device for PuTTY ? ” is that necessary for SSH”
thanks
Yes, you must have OpenSSH on your device before you attempt this tutorial. If you are jailbroken with Electra, it will automatically add it to your device.
i type in shh [email protected] in the login and does not work. it says it does not exist.
Can you send a screenshot?
I keep receiving a “No such file or directory” in putty when i run step 15. Help Please
on step 14 I can’t type in the terminal, how can I fix this
What can’t you type in the terminal? Is the window active?
For anyone having problems with step 12 on windows, I just typed ‘root’ which then allowed me to use alpine as my password. But other then that, it worked perfectly for me
cmd show message The syntax of the command is incorrect.
how to solve that
Why are you using command prompt? You need to use Putty.
When i attempt step 12, it says
Andrews-MacBook-Pro:~ andrew.gonzalez4$ ~ ssh [email protected]
-bash: syntax error near unexpected token `newline’
What can I do here?
Same problem for me I did include
Use English inputer
i got lost on windows step 10
Download and install Putty on your Windows and then follow the next step.
what do i do with the putty program?
Enter the commands we have used in Terminal.
Hello, after all the issues my device is finally jailbroken and it’s a fresh copy of cydia no more previous jail break remains to interfere with the new one. ALL my tweaks work except for anemone for some odd reason? I am installing it from the big boss repo, this is the error I encounter:
https://imgur.com/owRfU7Z
Could any one please assist me?
No fix right now except for using Delectra again.
Thx my phone stuck on Apple logo.
Use Reiboot tool.
If I do this, will my phone be deleted? I mean will I lose my chats and messages?
No, only jailbreak data will get erased, it’s not a complete iTunes restore.
When i attempt step 12, it says
Andrews-MacBook-Pro:~ andrew.gonzalez4$ ~ ssh [email protected]
-bash: syntax error near unexpected token `newline’
What can I do here?
Did you also include the “<>” in IP address?
It worked!!! Thank you so much!!!
Welcome.