Creating a Repository

In this lab we were given the task of creating our own YUM repository.  There are three main important parts to this task:

  1.  Create a GPG key
  2. Sign the package
  3. Put the files in a web accessible location

Creating a GPG key is actually quite simple you just enter one command:

gpg --gen key

Simply follow the steps associated with the above command and your key will be created successfully.  The reason why this key is being generated is because we need a key in order for us to be able to sign packages.

After the key has been successfully created then you want to edit the ~/.rpmmacros file and insert your key I.D that was created.  This ensures that when we sign a package it will use our key.  Below is a screenshot of my ~/.rpmmacros file.

After I edited the ~/.rpmmacros file I was able to successfully sign a package using the following command:

rpm --addsign packagefile

Signing the package allows a user to verify the source of a package. It also doesn’t ensure the integrity of the package, it just verifies the package’s source.

After the package has been signed,I executed and ran the createrepo program:

 createrepo .

This program creates an xml-rpm-metadata repository.

After creating the repository, I uploaded it to my matrix account and put it in the public_html directory.  Below is a link to my repository:

My Repo


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s