How to fix: “apt-get command not found” on Jailbroken idevice


Trying to run any apt-get command from an ssh session on your Apple device returns the error “apt-get command not found” similar to below:

Screen Shot 2017-02-08 at 3.39.48 PM


First things first we need to confirm that the dpkg package is installed and that it is at least  1.14.x



1) Confirm the files are in the /private/var/mobile/Media directory

# ls -l /private/var/mobile/Media

2) Confirm berkeleydb is installed

# dpkg -l | grep berkeleydb

If you do not receive any output, then it is not installed.

On the other hand if you see an output similar to the one below, then it is:

ii  berkeleydb                               4.6.21-5        iphoneos-arm Oracle’s embeddable database engine

To install berkeleydb, download and transfer these file to the base filesystem using ifunbox:

Then install it

# dpkg -i /private/var/mobile/Media/berkeleydb_4.6.21-1_iphoneos-arm.deb

3) Repeat step 4 for openssl using the link

4) Repeat step 3 for curl using the link

5) Download and transfer these file to the base filesystem using ifunbox

6) Install the apt package

# dpkg -i /private/var/mobile/Media/apt*

7) If you received no errors until this point, you can test apt-get by running:

# apt-get update

If you found this article useful, don’t forget to share it by clicking one of the buttons below. You can also share your thoughts in the comments section below.

You can also follow me on Twitter, add me to your circle on Google+, or like my Facebook page to keep yourself updated on all the latest of Hardware and Software articles.

Found this post useful?

Subscribe to our RSS feed, follow us on Twitter or help us grow by sharing our content using the buttons below

This entry was posted in Apple, Cydia, Jailbreak. Bookmark the permalink.

11 Responses to How to fix: “apt-get command not found” on Jailbroken idevice

  1. Kacper says:

    you are best!! Worked for me.

  2. Eugene says:

    Please help!

    I have the same problem with apt-get – it says “command not found” But when I try to fix it usin commands like this:
    dpkg -i /private/var/mobile/Media/berkeleydb_4.6.21-1_iphoneos-arm.deb
    I get an error message “Bad CPU type in executable”

    Looks like something bad happened with “dpkg” on my device. I’ve searched the for how to fix it, and the only thing I found was this – “apt-get install dkpg” But dpkg also doesn’t work! It’s a closed circle :((

  3. A. Agnelli says:

    Unfortunately for some reason I lost root access for my 10.3.1 jailbreak (done with g0blin). I am getting the “command not found” for su and sudo also. Can the above suggestion work for getting that back too or is there any other advice you can give? Many thanks, A.

  4. A. Agnelli says:

    Seems, you don’t have time to respond. I tried your instructions many times, and even though it shows, that I have root access (I can change passwd, for example), none of the commands (apt-get, su, sudo) can be found. I deleted/reinstalled all the packages above, updated, etc. – no effect. Waste of time.

    • I am sorry you feel it is a waste of time but if you want to direct message me on twitter @timourrashed, I will be happy to help.

      There is a reason I leave links to my social media on the bottom of every page

  5. A. Agnelli says:

    I have root access, all files seem to be installed (apt, aptitude, dpkg), still “command not found”, even after reinstalling the older versions of packages you posted. Should I have not updated them to the latest versions?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.