How To Create Your Own Yum Repository in Moblin

I received a question from an email on how to create your own yum repository.

I am basing it on Moblin/Meego, but should mostly work on Fedora/RedHat too.

I am assuming that you have already installed the development tools of Moblin in your installed Moblin distribution by using this command:

sudo yum groupinstall “Development Tools”

To start, we install the createrepo package – we can get it from the Manage Apps application in the Moblin Applications->Settings tab.

Once installed we can now create the repository using the commands:

mkdir -p /[path of your moblin repository root]/Moblin/[moblin-release version]/{SRPMS,i586}

We use i586, because Intel atom processors are basically of arch type i586.

You may want to create i386 generic files for whatever use you want, so you can use {SRPMS,i386,i586} instead above.

If you do so, you may want to automate the process by creating a bash script named createrepo.sh and writing in the following code:

destdir="[path of your moblin repository root]/[moblin-release version]"
for arch in i386 i586
pushd ${destdir}/${arch} >/dev/null 2>&1
createrepo .
popd >/dev/null 2>&1

Every time you add a package, call this script and it will create the metadata using the createrepo tool in the i386 and i586 directories.

Upload this directory structure to the server where you’ll be hosting your repository.

The .repo file you will create will most like be similar to this:

name=My Repository

$basearch will be the arch type of the distribution. For Moblin you can hardcode it to i586 instead.

Anyways, that’s about it. Cheers!


Leave a Reply

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