UbuntuHelp:PinningHowto
来自Ubuntu中文
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
Introduction to Pinning Packages
Pinning is a solution to be able to install packages from different Ubuntu releases on an Ubuntu system, without completely "polluting" your system with libraries and applications that are not meant for the version you are actually running. This guide will be when you need or want to install an older version of a program on a newer version of Ubuntu. This is important if you are running development versions of Ubuntu or any software that maybe in testing or unstable release -- example Firefox-3.0 in Hardy, it isn't stable so if a patch or new version causes something to break you can install the old version and pin the package so Apt or Synaptic doesn't keep wanting you to upgrade to the broken version. First way to pin a package is in Synaptic:
Open Synaptic Click on Search and type the package name in the Search box Highlight the version you want to pin '''Make sure its the version that is not broken''' Click on the menu item Package than click on lock version Close Synaptic
Second way is to pin it with Apt/Dpkg:
Open a terminal sudo -s and hit enter Enter your password for sudo echo libxfont1 hold | dpkg --set-selections '''Replace libfont1 with the package you want to pin''' Now run sudo apt-get update and than sudo apt-get upgrade
This part will be removing the pin that you used to pin the file. This should be when the package is fixed or removed. You can check what the next version of the package is by using apt-cache policy packagename To remove the pin in Synaptic:
Open Synaptic Search packagename Click on package Click on menu item packages Now click unlock Close Synaptic
To remove pin from Apt/Dpkg:
Open a terminal sudo -s and hit enter Enter your password for sudo echo libxfont1 install | dpkg --set-selections '''Replace libfont1 with the package you want to pin''' Now run sudo apt-get update and than sudo apt-get upgrade
NOTE At the time of the making this Wiki there is not a known way to Pin a package with Update Manager. Pinning should never be used for installing Debian binary packages on Ubuntu. Ubuntu strongly recommends against using Debian binary packages on Ubuntu,
Links
These documents were used as a foundation for this page, and might give you more background information:
- For Basic apt-get usage and instructions see AptGetHowTo
- The official Debian documentation