So I'm hosting a private apt repository.
The hierarchy looks like this:
├── stable
│ ├── main
│ │ └── binary-all
│ │ ├── Packages
│ │ └── mypackage_2.3.1_all.deb
│ ├── Release
│ └── Release.gpg
└── unstable
├── main
│ └── binary-all
│ ├── Packages
│ └── mypackage_2.3.2_all.deb
├── rc
│ └── binary-all
│ ├── Packages
│ └── mypackage_2.3.2_all.deb
├── Release
└── Release.gpg
My source file looks like this:
deb [arch=all] https://user:pass@my.apt-server.com/ stable main
deb [arch=all] https://user:pass@my.apt-server.com/ unstable main rc
apt-cache policy mypackage
mypackage:
Installed: (none)
Candidate: 2.3.2
Version table:
2.3.2 500
500 https://my.apt-server.com unstable/main all Packages
500 https://my.apt-server.com unstable/rc all Packages
2.3.1 500
500 https://my.apt-server.com stable/main all Packages
stable release file content (without the hashes):
Date: Wed, 12 Oct 2016 09:29:19 UTC
MD5Sum:
0 Release
707 main/binary-all/Packages
SHA1:
0 Release
707 main/binary-all/Packages
SHA256:
0 Release
707 main/binary-all/Packages
SHA512:
0 Release
707 main/binary-all/Packages
unstable release file content (without the hashes):
Date: Wed, 12 Oct 2016 09:29:27 UTC
MD5Sum:
0 Release
709 main/binary-all/Packages
705 rc/binary-all/Packages
SHA1:
0 Release
709 main/binary-all/Packages
705 rc/binary-all/Packages
SHA256:
0 Release
709 main/binary-all/Packages
705 rc/binary-all/Packages
SHA512:
0 Release
709 main/binary-all/Packages
705 rc/binary-all/Packages
The problem is, when I try to install from stable by running the command:
sudo apt-get install -t stable mypackage
it still installs the latest package from unstable/main
mypackage_2.3.2_all.deb
and not the package from stable/main
mypackage_2.3.1_all.deb
I also tried pinning (from this answer) by creating a file under /etc/apt/preferences.d with:
Package: *
Pin: release n=unstable
Pin-Priority: 50
but still a higher version from unstable is installed.
What am I doing wrong?