Update All Your Computers with a .DEB Repository

Let all of your computers update your software automatically. Once you’ve packaged your scripts, put them in your own repository. Your workstations and servers can then automatically install latest versions of your programs.
Prequisites: Packaging, Apache web server, Command line, Commands for Admin (sudo, apt)
First, create your own package. For example, you can create a metapackage.
Install a web server and enable user homepages.
This procedure was succesfully tested by more than 20 students on Ubuntu 11.04 Natty 32bit.

Create and Configure Empty Repository

$ cd
$ cd public_html/
$ mkdir -p repository/conf
$ nano repository/conf/distributions
Codename: lucid
Components: main
Suite: lucid
Architectures: i386 amd64 source

Add .deb Packages

Use your own package here

$ reprepro -VVVV -b repository/ includedeb lucid teros-scripts/teros-*.deb

Install Repository to Clients

On client:

$ sudoedit /etc/apt/sources.list.d/repository.list
deb lucid main

Then you can install and update packages

$ sudo apt-get update
$ sudo apt-get install teros-scripts

Update: nano /etc/… -> sudoedit /etc/… Tested by 20+ students.

Posted in Uncategorized | Tagged , , , , , , , | 5 Comments

5 Responses to Update All Your Computers with a .DEB Repository

  1. Tero Karvinen says:

    Make slaves (workstations & servers) install updated packages automatically (not yet tested):
    APT::Periodic::Update-Package-Lists “1”;
    APT::Periodic::Download-Upgradeable-Packages “1”;
    APT::Periodic::AutocleanInterval “7”;
    APT::Periodic::Unattended-Upgrade “1”;

  2. Tero Karvinen says:

    Fix: “nano /etc/apt/sources.list.d/repository.list” -> should be “sudoedit /etc/apt/sources.list.d/repository.list

  3. Tero Karvinen says:


  4. To sign a repository:
    – Create a key pair with GnuPg, iirc: gnupg –gen-key
    – Modify reprepro config, add SignWith: tero@example.com
    – Recreate the repository by adding a new package (adding an existing pkg does not trigger rebuild)
    – Extract key, something like: gnupg –export –armor tero@example.com > aptkey.pgp
    – Import the key to client/slave: sudo apt-get key add aptkey.pgp
    – Use normally, sudo apt-get update && sudo apt-get install teros-lab
    I have written these signing notes from memory, without testing them on a computer at the same time. I’m sure you need some command line foo to make them work.

  5. Juha-Matti Laaksonen says:

    I overheard a conversation about creating and hosting debian packages and even paying to some service about it. I show’d them this article and the one where the actual packages are made, and then we had a complete silence in the room!
    // lennu