I put jessie-backports in my /etc/apt/sources.list, but it seems that apt will not automatically use the packages from backports but older packages.However, if I use apt-cache show to check the version it shows the latest, and I am able to use apt install xxx=<latest-version> to install it.How to tell apt always use the latest package by default?
How to tell apt to use the latest package by default?
debian;apt
As @cutrightjm has mentioned apt-pinning is the solution.If you create a file /etc/apt/preferences.d/backports with the following contentPackage: *Pin: release a=jessie-backportsPin-Priority: 800apt will always install packages from jessie-backports, except when you pin another package source with a priority higher than 800.If you want to see all available versions of a package, their priority and which one will be installed, you can use apt-cache policy <packagename>.