How to install a .deb file via SSH and terminal

Hey guys, this tutorial was a request from one of our readers, Mason, who was having trouble finding Ultrasn0w in . This is a great method to quickly install any . file on your iDevice from your computer. This is useful if Cydia won't install an app for whatever reason or you just can't find the app in the database. In this tutorial I will be installing the ultrasn0w since that is the specific tweak that Mason was having trouble with.

Step 1: Go into Cydia and search for "OpenSSH" and install it if you haven't yet. This will allow connections between your phone and your iDevice(please note that the computer and the iPhone have to be on the same network in order for this to work, otherwise you need to forward ports and get your static IP and it gets a little more complicated).

Step 2: now that you have OpenSSH installed you are going to need to get a PC client in order to communicate with your device. IMO is the best program for Windows, you can download it here

Step 3: Now you need to find the .deb file you want to install, this is pretty easy just go to Google and type in the name of the app you want to download and add "deb download" to the end of it. In this case I would type "ultrasn0w deb download" after you have downloaded the deb(Ultrasn0w 1.1-1 deb here), the best thing to do is rename it to something very short(you will see why in a little bit). The name of the file doesn't matter as long as it ends in the extension .deb I have renamed the ultrasn0w deb from ultrasn0w-1.1-1.deb to us.deb

Step 4: Open up WinSCP and the first screen you come up to is the login screen. Click "new" in the top-right and copy the information as seen below into your screen(you can find your iDevice's IP address by opening up SBSettings or by going into the wi-fi section under settings if you don't have sbsettings). Change the "Host name" to whatever your iDevice's IP address is. The username is "root" by default for all iDevices and the password is "alpine" you can and SHOULD change your SSH password but that's for a different tutorial. Now click "save" and name the connection and then connect. If you get a pop-up box when you connect this is normal just click the far left option.

Step 5: After you have connected you will see a directory of your iDevices filesystem. Navigate to private/var/tmp this is where you want to upload the deb that you just downloaded and renamed, so in the left column navigate to the folder where your .deb is saved and in the right column navigate to private/var/tmp and drag the deb from the left side into the right side to transfer it over to your device.

Step 6: Now that you have the deb on your iDevice in the tmp folder it is time to install it. This part is extremely easy once you've done it a few times(in fact, this whole process is extremely easy after you've done it a few times, I've gotten to the point where it takes me less than a minute from start to finish for this whole process). Click the little -like icon directly under the "S" in the word "Session" on the top menu. This will open up a window which should be familiar to mac users and will kind of resemble DOS for Windows users. Then all you do is type in the following command(Please note you have to have Cydia fully closed before executing this command):

/tmp/us.deb

This is where the shorter filename comes in handy. Many deb files will have prefixes or suffixes containing the name of the repo they came from and this just makes it a little easier to type in the command. Obviously if you are installing a different deb you would change the last part to reflect the filename of your deb. Your terminal screen should now look identical to how Cydia would look if you were installing through Cydia. When it says "setting up....." that's how you know it's done. Now just respring your device and the app will be installed just as if you did it through Cydia!

So that's about all I can think of right now, if any of this is unclear or you are having trouble please comment and let us know so we can try and get any issues resolved for you. Thanks!

  • Mason

    hey man i appreciate this. having another problem though. every time i enter dpkg -i /tmp/us.deb i get an error msg

    failed with return code 1
    dpkg: error processing tmp
    cannot access archive no such file directory

    any ideas?

  • Mason

    ok i figured it out and got it installed . anything further? its back on the ol searching spree. how can i tell if i did this correctly?

  • Mason

    im also having an issue with itunes
    cannot backup iphone because a session could not be started
    any ideas on this one lol?

  • http://iphoneblogr.com JaeM1llz

    Glad you figured it out Mason, I forgot to mention that you can’t have Cydia open while you do this. The error you mentioned can sometimes be due to anti-virus programs. Here is a solution you could try, copy your latest device backup to your desktop /Users/USERNAME/Library/Application Support/MobileSync/Backup is where you can find it. Then you want to go into iTunes and delete all your previous backups here’s how:

    1) Go to iTunes>Preferences>Devices
    2) In the “Device Backups” window select your last backup on that device. If you have other iPhones they will show up as well…so choose the device your having issues with.
    3) When you’ve selected the correct device and the last backup the button that says “Delete Backup” will darken. Click it.
    4) Continue and click “OK” when prompted.
    5) Go back into your iTunes window and **right click** on your device that is having backup issues.
    6) In the pop up window choose “Backup”.

    See if that fixes it

  • http://iphoneblogr.com JaeM1llz

    If you see “setting up …” that means it worked, you have to respring the device to reflect the changes though.

  • Mason

    no dice. its still giving me the backup error it wont start a session with my iphone.
    im checking antivirus out. Any other possibilities?

    • http://iphoneblogr.com JaeM1llz

      That’s the only solution I’ve seen so far, you could give this a shot:

      Edit>Preferences>Device>Reset Sync History

      Other than that, I’m stumped

    • http://iphoneblogr.com JaeM1llz

      Did you by chance hacktivate your iPhone? I heard that hacktivating can cause this error, if you can try without hacktivating and use an AT&T sim to activate and see if it solves your issue.

      • Mason

        i did hacktivate. That is the problem, is there a solution to this one?

        • http://iphoneblogr.com JaeM1llz

          Just make a new modified firmware file with sn0wbreeze but don’t choose the option to hacktivate, just activate it normally with an AT&T or phonebook sim card.

          • Mason

            do i even need hacktivation to unlock once ultrasn0w comes up with unlock for 4.1?

  • Mason

    Damn, nothing… this is posing to be quite difficult. I shall do some research

  • Lee

    Bitvise Tunnelier is way better than Win SCP, try both and make your own decision though.

  • http://evanstonpizzadelivery.com Delivery in Evanston

    Good stuff. Looking forward to reading more from you.

  • Pingback: How to enable HD Video on iPhone 3Gs (Video Tutorial) | iPhone Blogr

  • Harley

    Hey Jae,
    I’m trying to follow these instructions, but I’m getting stuck at the terminal. I put in dpkg -i /tmp/us.dep (I renamed the .dep like yours, us.dep). I hit execute, but I’m getting this error message:
    /private/var/root$ dpkg -i /tmp/us.dep
    dpkg: error processing /tmp/us.dep (–install):
    cannot access archive: No such file or directory
    Errors were encountered while processing:
    /tmp/us.dep
    Please help. Thank you.

    • http://iphoneblogr.com JaeM1llz

      That’s because it’s supposed to be “.deb” not “.dep”

    • Shroomiee

       .derp

  • newton_tony

    Hi.

    I’ve followed the excellent instructions (with Cydia closed on my ipHone 4). When I re-open Cydia it tells me Ultrasn0w 1.2 is installed, despite having removed it via Cydia and installing the 1.1 deb file as per your instructions.

    Any suggestions? Thanks.

  • zac

    great tutorial, understood every word for a noob like me! question – after whole process is complete, what do i do with deb file, delete from var/root folder or leave it in there?

  • Pingback: How to re-enable iBooks on a jailbroken iDevice using Comex’ Honeypot | iPhoneBlogr.com

  • Pingback: Ultrasn0w 1.2.1 out now fixes 4.3.1 unlocking issues | iPhoneBlogr.com

  • rabinshr

    Great tutorial..
    worked great for me.
    Thanks heaps

    • http://iphoneblogr.com JaeM1llz

      You’re very welcome, glad you found it useful!

  • Pingback: Winterboard 0.9.3900-1 released for iOS5 compatibility | iPhoneBlogr.com

  • sammy

    hi im trying to install installous since it gives hash sum mismatch on my ipad 1 5.1 but when i execute the command it shows:
     Errors were encountered while processing:
     /tmp/installous.deb

    what does that mean?
    how do you fix it?

    sorry im a total noob

    • JaeM1llz

      We do not support piracy here.

  • Pedro V

    Could i use a dpkg -i to install SBsettings  on iOs 6 ? (via ssh using developer-only thetered jailbreak)?

    • JaeM1llz

      It most likely would not work. Most Cydia packages are not going to be compatible with iOS6.