I am working on a cmake project where we create a .deb package with cpack containing a C++ library. The goal is to have a pipeline running at the main branch which generates the package and places it at our local repository, same under the dev branch.
Now, to distinguish the packages that would have the same name I would like to use the -t option from the apt install -t target packagename to decide if I install the package from main that is at a local repository, for e.g., "/stable" or the package from dev that is located at the local repository "unstable".
So far I have not figured out how to achieve this. When I have a package with the same name on different local repositories, how can I uniquely identify which one to install?
I figured it out, so I post here in case anyone finds it useful.
In sum:
At sources.list I added my local sources:
At at each repository folder I have at the beginning of the "Release" file the following:
And the same for the "stable" repository.
Then by doing
sudo apt-get install -t unstable packagenameit installs from the unstable repository, if I dosudo apt-get install packagenameit installs from the stable repository.