Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Aug 14 '11 at 17:53

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer
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 '11 at 11:28

Your Answer


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.