在没有构建的情况下从较新版本安装软件包(apt pinning)

我需要这些包与最新的上游版本为ubuntu / natty反向移植

  • libccid_1.4.5-0ubuntu1_amd64.deb
  • libpcsclite1_1.8.1-0ubuntu1_amd64.deb
  • libpcsclite-dev_1.8.1-0ubuntu1_amd64.deb
  • libusb的-1.0-0_1.0.9-0ubuntu1_amd64.deb
  • 的libusb-1.0-0-dev_1.0.9-0ubuntu1_amd64.deb
  • opensc_0.12.2-1ubuntu1ppa1〜natty1_amd64.deb
  • pcscd_1.8.1-0ubuntu1_amd64.deb pcsc-tools_1.4.18-0ubuntu1_amd64.deb

我尝试使用更新从源代码构建它们但它失败了。 我不是包装专家,那里有很多教程和食谱。

你知道一个好的和最新的backporting Ubuntu包教程吗?

如何从其他版本获取软件包而无需自己构建软件包?

探索apt pinning会更好,请参阅man apt_preferences

让我们假设你在Oneiric上,你想从Precise那里获得这些包。

如果您阅读该文章man您会看到我复制/粘贴了相关部分,并修改了版本名称

/etc/apt/preferences

 Package: libccid Pin: release n=precise Pin-Priority: 990 Package: libpcsclite* Pin: release n=precise Pin-Priority: 990 Package: libusb* Pin: release n=precise Pin-Priority: 990 Package: opensc Pin: release n=precise Pin-Priority: 990 Package: pcscd Pin: release n=precise Pin-Priority: 990 Explanation: Uninstall or do not install any Ubuntu-originated Explanation: package versions other than those in the oneiric release Package: * Pin: release n=oneiric Pin-Priority: 900 Package: * Pin: release o=Ubuntu Pin-Priority: -10 

然后,我将/etc/apt/sources.list复制到/etc/apt/sources.list.d/precise.list并用精确替换了所有出现的oneiric。 然后运行apt-get update ,最后运行apt-get upgrade

 $ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: libpcsclite1 libusb-0.1-4 libusb-1.0-0 libusbmuxd1 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 86.0 kB of archives. After this operation, 88.1 kB disk space will be freed. Do you want to continue [Y/n]? y Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main libusb-0.1-4 amd64 2:0.1.12-20 [17.6 kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main libusb-1.0-0 amd64 2:1.0.9~rc3-2 [30.9 kB] Get:3 http://us.archive.ubuntu.com/ubuntu/ precise/main libpcsclite1 amd64 1.7.4-2ubuntu1 [23.5 kB] Get:4 http://us.archive.ubuntu.com/ubuntu/ precise/main libusbmuxd1 amd64 1.0.7-2 [14.1 kB] Fetched 86.0 kB in 0s (124 kB/s) 

出于某种原因,pcscd和opensc没有安装,可能是因为它没有安装开始所以没有什么可以升级,没什么大不了的,我可以使用精确作为参考安装那个版本。

 apt-get install opensc pcscd -t precise 

注意使用-tpackagename/precise也可以。

并且有你想要的软件包,从最新版本开始, 只有那些软件包 ,它们也会自动更新。 如果您不再需要它们,只需删除/etc/apt/preferences的条目,下次运行apt-get upgrade它们将被删除。 如果您删除整个prefs文件,请务必删除该precise.list源文件以及我们的系统将尝试更新到最新的软件包集。 此外,如果您决定稍后进行dist-upgrade,则需要删除整个prefs文件,删除其他sources.list可能是个好主意。由于优先级较高,升级会找到,因为没有要更新的包。

Apt钉扎并不是那么难,你只需要挖掘一点并进行实验。 通过检查apt-cache policy找到n= etc的所有动词。

这就是为什么经验丰富的管理员咆哮和狂热关于apt vs yum。 您可以简洁地更新服务,并以干净,确定和可维护的方式使其保持最新状态。

不再编译包。

我强烈建议您阅读整个手册页并熟悉这个概念,并在继续提交此建议之前阅读其他有关apt pinning的指南。 祝好运并玩得开心点!

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