Setting up Reprepro repository

So we wanted to create a repository for our configuration packages and reprepro seemed like a good and easy way to go. So I started making a script to the fabfile for installing and configuring it using this tutorial. I got the script done, tested it, and soon realised that it didn’t work. The distributions file was missing a line and the packages didn’t get added to the repository. So with the help of  Armens I made some improvements to the script and got it working. Here’s our new working reprepro conf/distributions file:

Origin: Awase
Codename: natty
Label: Awase-All
Suite: stable
Version: 0.1
Architectures: i386 amd64 source
Components: main non-free contrib
Description: AwaseConfigurations

This distributions file and reprepro is installed to our webserver with our fabric task reprepro_setup() and the task gets run during our main() task.

Adding our configuration packages to the repository is done by first  copying the package to our public_html directory and then adding it to the reprepro with this command:
reprepro includedeb natty package-name_0.1_all.deb

We do this with fabric using our add_to_repo() task which adds all of our packages to the repository.

Final task is to add our package repository to the package source list of each machine. It is done by adding a new source file to /etc/apt/sources.list.d/ and the source file should include this line:

deb http://host1.local/~ubuntu/ natty main

The new source can be added to our every machine with our fabric task add_reposource().

Now it’s possible to install our config packages to any of our machines  simply with:
sudo apt-get install package-name

or with our fabric task:
fab install:package-name

All of these fabric tasks mentioned here can be found from our fabfile.

Advertisements

, , , , , , , , ,

  1. #1 by Albert Burgio on August 10, 2018 - 9:47 pm

    Please let me know if you’re looking for a article writer for your blog.
    You have some really great posts and I think I would be a good asset.
    If you ever want to take some of the load off, I’d really like to write some material for your blog
    in exchange for a link back to mine. Please shoot me an e-mail if interested.
    Many thanks!

Leave a Reply

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

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: