I am working on a debian package which usually installs in /tftpboot/linux/ This packages is also distributed on UCS (Univention Corporate Server), a debian based server system.

They need these files in another directory (/var/lib/univention-client-boot). How do I adapt the corresponding debian files to make it recognize if the system is UCS and then move the files to the directory, or link these directories during install of this deb file?


You could do this in a .postinst script - check to see if it is being installed on the UCS server and create the required directory structure (under /var/lib/var/lib/univention-client-boot) and symlnks.

Note that if you want to follow debian policy, the symlinks should be made relative (to the directory containing the symlinks), not with absolute paths. For a private package, strict adherence to debian policy isn't necessary.

You should also have a .postrm or .prerm script to remove the symlinks (and the directories, if they are empty) when the package is removed.


You would need a version of dpkg that understands it needs to use a different root than /. I have not heard of such a beast.

If this is just an incidental case, you can unpack the package by hand into a specified location:

dpkg-deb --extract whatever.deb /var/lib/univention-client-boot/

This will simply dump the packaged files using that location as the root. No record is made of the package being installed, nor are any pre-/post-install scripts run.

If you are buiding the .deb yourself, you should make a separate version (e.g. add -UCS to the version) specially for that system. You will need to create the necessary directory structure in the staging area for that before constructing the .deb.

  • I forgot to mention that I am building this package on open build service. This builds the package for me. I need a way to distinguish this specific debian derivate and either install the files into another directory or just link the standard directory to the UCS specific – raddirad Nov 12 '15 at 12:32

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.