Saturday, April 30, 2016

Is there a way to restrict the packages installable from a repository?



I want to restrict the packages installable from a repo, eg restrict some packages to the main Ubuntu repos, even if they are available from launchpad or some other third party repos, something like pinning some packages to certain repository.




Normally the repository last added repo takes over all the packages which were available in other earlier repos.



To set up AptPreferences for a set of packages add a new file in /etc/apt/preferences.d/.



sudo gedit /etc/apt/preferences.d/my-packages-pin


Add add the following lines in that file:



Package: package1 package2

Pin: release o=Ubuntu
Pin-Priority: 900


I will prevent ppa versions to replace packages provided by the main Ubuntu archives



To check if the package pin version run:



sudo apt-cache policy package1



Visit https://help.ubuntu.com/community/PinningHowto


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...