# How to target a specific version of a Linux distro with CPack?

**URL:** https://discourse.cmake.org/t/how-to-target-a-specific-version-of-a-linux-distro-with-cpack/11282
**Category:** Usage
**Created:** [July 19, 2024, 7:50am UTC](https://discourse.cmake.org/t/how-to-target-a-specific-version-of-a-linux-distro-with-cpack/11282 "2024-07-19T07:50:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ajbclarfu](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/958977/32.png) [@ajbclarfu](https://discourse.cmake.org/u/ajbclarfu)
#### Post date: [July 19, 2024, 7:50am UTC](https://discourse.cmake.org/t/how-to-target-a-specific-version-of-a-linux-distro-with-cpack/11282/1 "2024-07-19T07:50:31Z")

</div>

How to target a specific version of a Linux distro with CPack? Suppose I want to generate several deb files each one targeting a different version of a Linux distro. How do I do that? My hypothesis is that CPack packages for the version of the distro I am running. Is that correct?

---

<div class="post-metadata">

### Author: ![neundorf](https://discourse.cmake.org/user_avatar/discourse.cmake.org/neundorf/32/2075_2.png) [@neundorf](https://discourse.cmake.org/u/neundorf)
#### Post date: [July 24, 2024, 8:10pm UTC](https://discourse.cmake.org/t/how-to-target-a-specific-version-of-a-linux-distro-with-cpack/11282/2 "2024-07-24T20:10:59Z")

</div>

I suggest you build on the oldest version of debian (or ubuntu or something) which you want to support, and then see how that package works on the newer versions of the distribution.

You may have to create some post install scripts to handle differences between the distributions.  
I.e. you would create only one package, but make that work on all versions.
