How to build and host a Cydia Repo

Over at JBQA I’ve seen the occasional query about how to host a Cydia Repository. Since I figured it all out and did it myself, I should go ahead and tell how I did it. I started by reading the very good article written by @Saurik and found some other bits and pieces elsewhere and by using the time-tested trial and error method.

Introduction

There are several things you have to do in order to host a Cydia repo. It is not really that hard. Believe it or not, I do a good portion of the setup and maintenance of my Pepper dot Net repo (www.pepper.net) directly on my iPhone.

A repository is simply a particular arrangement of files on a website, so the first thing you need is a website hosted somewhere. The only requirements are that it support HTTP on port 80, and has (or you can add) a defined MIME-type of “application/x-deb” for .deb files.

You also need to know how to create and maintain package (.deb) files, and how to generate the Packages and Release files. In this article I’ll be covering all of this except for the actual package files, that will need another more detailed article all its own. In the meantime, you can read Saurik’s definitive article on the subject. His article mentions a tool “dpkg-scanpackages” which is included in my repotools package, mostly because I got tired of installing it manually every time I wipe my development device.

Requirements

Before this will work, you need the APT packaging system, this file (or install repotools package) and some implementation of Perl. If you’re going to do this on your iDevice, APT is already there as part of Cydia, and I get the perl package from CoreDev.nl.

Here’s an overview of the repo file structure. Simply create and upload each of these to your website. When everything is there you can add your repo to Cydia and hopefully everything will work.

Control files

The first three files should appear in the root folder of your website (technically the “root” of the URL you intend to use for the repo, it doesn’t have to be the “root” of the whole site).

  • CydiaIcon.png
    Use your favorite PNG editing program to create an icon. It will appear in Cydia (1.1 and later) next to your repo in the “Manage Sources” area.

 

  • Packages.bz2
    This file is generated from the individual control files of each of your packages and then compressed. It has a specific format that I won’t get into at this point, but the important thing to remember is you need to regenerate it any time you add, change or delete packages. The commands I use are:

    ./dpkg-scanpackages -m [name.of.repo.folder] /dev/null >Packages

    followed by

    bzip2 Packages
  • Release
    This is a plaintext file containing some basic information about your repo. The fields are self explanatory and there are additonal, optional fields. These few fields are plenty enough to get started. Among other things, this information determines part of what appears in the description of your packages when viewed in Cydia.
Origin: Pepper dot Net
Label: PepperdotNet
Suite: stable
Version: 0.3
Architectures: iphoneos-arm
Components: main
Description: Welcome to the experimental repository from www.pepper.net! @PepperdotNet on Twitter

Package Files

Put all of your packages (the .deb files) in the repo folder. While technically they could be in the root, I suggest a separate folder to keep things organized. It works best if the name of this folder is exactly the same relative to the root, as where the packages were when you generated the Packages.bz2 file relative to where you ran the command from.

As mentioned before, you’ll need to regenerate Packages.bz2 anytime you add, change or delete packages.

Conclusion

That’s about all you need to know to get started hosting your own Cydia repository. Good luck, and let me know in the comments area if you have any questions and something about your new repo!

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

5 Responses to How to build and host a Cydia Repo

  1. avatar Nankz says:

    thank you dude for this nice instruction

  2. Dear,

    thank you for this very nice and good tutorial! But I have just one only issue, little one do, my icon doesn’t show up. I’ll mean the main repo icon, I’ll already played a little with the actual size. from 50 to 150 but with out any success. I do understand the icon need to go in to the “repo root” and name as CydiaIcon.png. Also after I delete the whole repo and add him back, nothing. Little strange 🙂 Any idea’s?

    Many thanks!
    Regards,
    Jonas

  3. avatar iRoc999 says:

    If I’m understanding this right, You are actually using your iPhone to host the repo?
    How would you handle a PayPal link for paid packages?

    • avatar Pepper says:

      Not quite.

      While it might be worth running a webserver on an iPhone for the “cool factor” alone, in reality it’s just not practical. My repo is instead hosted on some boring server in a rack somewhere in a data center.

      Where iOS is involved is building, testing and packaging the .deb and associated pieces. I could have spent a lot of time and effort building a new machine, figuring out which Linux distro to use, and making it all work, but The Perl scripts I needed and Perl itself already work on iOS, plus I have to test my stuff on iOS anyway; may as well build and package there as well.

      Regarding PayPal, I’ll cross that bridge when I build something good enough to actually charge money for. If somebody really wants to pay me, I trust they can find the donate button on the site.

  4. avatar Jeffrey says:

    Hi

    That’s a great brief.

    Anyway I’m also hosting a repo, but one thing i’m trying to do is to get user a package install alert whenever they add my repo like some u might know to install their Sections and Repo icons.

    I have everything work good also sections icon but only manually install the app. So pls share if you know how to get it automatically pre-install along with repo when user add it.

    Cheers

    Jeff

Leave a Reply

Your email address will not be published. Required fields are marked *