How to install a single package from a newer distribution on Ubuntu
Short answer: apt pining
In the following example, I will install jdupes from Focal on Eoan.
edit source.list
sudo gedit /etc/apt/sources.listand add focal repositoryadd pining policy
sudo gedit /etc/apt/preferences.d/fetchupdate-or-any-other-name.pref
Package: *
Pin: release n=focal
Pin-Priority: 10
Package: jdupes
Pin: release n=focal
Pin-Priority: 5003. sudo apt-get update
4. Check if pining works apt-cache policy jdupes
~$ apt-cache policy jdupes
jdupes:
Installed: 1.13.2-1
Candidate: 1.14.0-2
Version table:
1.14.0-2 500
1 https://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
*** 1.13.2-1 500
500 https://archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
100 /var/lib/dpkg/statusNote that *** marks the currently installed package and "1" before the url is not final. It seems the number after the version number is the final pin-priority and "Candidate" is the final select.
Please also check another package, for example tracker, to verify that other package from focal repository is not selected.
5. sudo apt install jdupes
Last updated