I have a private Debian repository setup with a few custom built packages (along with other official Debian packages). All my machines have this repository(only) configured in /etc/apt/sources.list. I want to know if there is a way to serve certain packages to certain machines.

For example - machine1 should be able to connect to the repository but should be able to download package1 and package2 only. machine2 should not be able to upgrade package1 even if a new version is available in the repository.

I know how to do the above on the client side - by running (or not running) the appropriate commands on machine1 and machine2. I want to automate this - I was planning to run a cronjob on those machines to do apt-get update && apt-get upgrade once every day but only the packages intended for them should be installed/upgraded.

I have looked up online for weeks but couldn't find anything useful. Is this even doable?

1 Answer 1


You won't be able to do this with a single repository, because the package index (the Packages file) is common to all clients. Well, actually, you can, if you serve the package index dynamically (e.g. with a CGI or other server script). But I don't think there are any read-made tools for that, you'd have to write your own generator (it wouldn't be very complicated, mind).

The simplest approach would be to put each set of separately-available packages in its own repository, and allow each client to access only the repositories containing the packages that they must be able to access.

  • Thanks for the response. I guess I can't go the cgi route as the client machines are accessing the repository over ssh using the following format: deb ssh://repo-owner@repo.server.com:/home/repo-owner/debian/ ./ (debian-administration.org/articles/513). Having separate repositories is not an option either as there are loads of client machines and package versions. Any other ideas you can think off?
    – Debianuser
    Aug 16, 2011 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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