Install specific version when using apt

When you need specific version of package, you can install the version you want using apt.

To show the list versions of package,

 $ sudo apt-cache policy <package-name>

To install specific version,

$ sudo apt install <package-name>=<version-you-want>;

Example:

$ sudo apt-cache policy librealsense2
librealsense2:
  Installed: (none)
  Candidate: 2.16.4-0~realsense0.127
  Version table:
     2.16.4-0~realsense0.127 500
        500 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial/main amd64 Packages
     2.16.3-0~realsense0.115 500
        500 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial/main amd64 Packages
     2.16.3-0~realsense0.103 500
        500 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial/main amd64 Packages
     2.16.3-0~realsense0.97 500
        500 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial/main amd64 Packages
...

$ sudo apt install librealsense2=2.11.1-0~realsense0.70

To prevent upgrade,

$ sudo apt-mark hold <package-name>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.