Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm looking on how to setup a private apt repository (on 10.04 LTS) that can support multiple versions.

I understand that you cannot have multiple versions of a package installed on a server. This is a purely for a development environment where we want to be able to test multiple versions before releasing them to the production apt repository.

I know you can have multiple versions by putting the version number in the package name, however I want to achieve the opposite, support multiple versions of a same package name.

e.g. packagename_1.0_all.deb and packagename_2.0_all.deb rather than packagename-1.0_1.0_all.deb and packagename-2.0_2.0_all.deb

For those that are familiar with Puppet automated eployment - we can specify what version of a package we want on a server (with the ensure tag using the same package name).

I've tried Google's debmarshal described at http://wiki.debian.org/HowToSetupADebianRepository but could not get it to work due to a lack of documentation.

share|improve this question
add comment

2 Answers

Host it under a different distribution name. lucid and testing for example. Then change your entries in your test box
from: deb http://homegrown.local/ubuntu lucid main
to: deb http://homegrown.local/ubuntu testing main

share|improve this answer
add comment

I needed a multi-versioned repo for the same reasons like you and this is what I ended up with:

apt-get install apache2 dpkg-dev
mkdir -p /var/www/repo/binary

Then create update-repo.sh that will update your repo with the packages' info

#!/bin/bash
cd /var/www/repo
dpkg-scanpackages -m binary /dev/null | gzip -9c > /var/www/repo/binary/Packages.gz

Place your .deb files in /var/www/repo/binary and run update-repo.sh

On the rest of the machines:

echo "deb http://myserver/repo binary" > /etc/apt/sources.list.d/myrepo.list
apt-get update

etc etc...

The magic happens because of -m when running dpkg-scanpackages. Without -m, only one version is listed in Packages.gz

I haven't tried it but it should be trivial to do the same for separate sub-repos, like hbdgaf proposed.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.