Wednesday, July 26, 2017

How to set up priorities for installing package using apt-get


References

Example

  •  In the following setup officially nvidia-provided driver is to be installed.
$ vim /etc/apt/preferences.d/cuda
Package: *
Pin: origin "developer.download.nvidia.com"
Pin-Priority: 1000
  •  Check status using `apt-cache policy`
$ sudo apt-cache policy nvidia-375*
nvidia-375-dev:
  Installed: 375.51-0ubuntu1
  Candidate: 375.51-0ubuntu1
  Version table:
     375.82-0ubuntu0~gpu16.04.1 500
        500 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial/main amd64 Packages
     375.66-0ubuntu0.16.04.1 500
        500 http://kr.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages
 *** 375.51-0ubuntu1 1000
       1000 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
        100 /var/lib/dpkg/status
     375.26-0ubuntu1 1000
       1000 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
nvidia-375:
  Installed: 375.51-0ubuntu1
  Candidate: 375.51-0ubuntu1
  Version table:
     375.82-0ubuntu0~gpu16.04.1 500
        500 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial/main amd64 Packages
     375.66-0ubuntu0.16.04.1 500
        500 http://kr.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages
 *** 375.51-0ubuntu1 1000
       1000 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages
        100 /var/lib/dpkg/status
     375.26-0ubuntu1 1000
       1000 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  Packages












No comments: