编辑了/etc/apt/preferences,添加如下:
Package: *
Pin: release o=apt-build
Pin-Priority: 990
yanglinxin@yanglinxin-laptop:~$ apt-cache policy
软件包文件:
100 /var/lib/dpkg/status
release a=now
500 http://dl.google.com stable/main Packages
release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
origin dl.google.com
500 file: apt-build/main Packages
500 http://archive.ubuntu.org.cn karmic/main Packages
release v=9.10,o=LP-PPA-tualatrix-gloobus,a=karmic,n=karmic,l=Ubuntu,c=main
origin archive.ubuntu.org.cn
500 http://packages.medibuntu.org karmic/non-free Packages
release v=9.10,o=Medibuntu,a=karmic,n=karmic,l=Medibuntu,c=non-free
origin packages.medibuntu.org
500 http://packages.medibuntu.org karmic/free Packages
release v=9.10,o=Medibuntu,a=karmic,n=karmic,l=Medibuntu,c=free
origin packages.medibuntu.org
500 http://debian.mur.at experimental/main Packages
release v=None,o=Unofficial Multimedia Packages,a=experimental,n=experimental,l=Unofficial Multimedia Packages,c=main
origin debian.mur.at
500 http://archive.ubuntu.org.cn karmic/main Packages
release v=9.10,o=LP-PPA-tualatrix,a=karmic,n=karmic,l=Ubuntu,c=main
origin archive.ubuntu.org.cn
500 http://archive.ubuntu.org.cn karmic/main Packages
release v=9.10,o=LP-PPA-rvm-testing,a=karmic,n=karmic,l=Ubuntu,c=main
origin archive.ubuntu.org.cn
500 http://ppa.launchpad.net karmic/main Packages
release v=9.10,o=LP-PPA-rvm-libs,a=karmic,n=karmic,l=Ubuntu,c=main
origin ppa.launchpad.net
500 http://tw.archive.ubuntu.com karmic-backports/multiverse Packages
release v=9.10,o=Ubuntu,a=karmic-backports,n=karmic,l=Ubuntu,c=multiverse
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-backports/universe Packages
release v=9.10,o=Ubuntu,a=karmic-backports,n=karmic,l=Ubuntu,c=universe
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-backports/main Packages
release v=9.10,o=Ubuntu,a=karmic-backports,n=karmic,l=Ubuntu,c=main
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-backports/restricted Packages
release v=9.10,o=Ubuntu,a=karmic-backports,n=karmic,l=Ubuntu,c=restricted
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-proposed/multiverse Packages
release v=9.10,o=Ubuntu,a=karmic-proposed,n=karmic,l=Ubuntu,c=multiverse
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-proposed/universe Packages
release v=9.10,o=Ubuntu,a=karmic-proposed,n=karmic,l=Ubuntu,c=universe
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-proposed/main Packages
release v=9.10,o=Ubuntu,a=karmic-proposed,n=karmic,l=Ubuntu,c=main
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-proposed/restricted Packages
release v=9.10,o=Ubuntu,a=karmic-proposed,n=karmic,l=Ubuntu,c=restricted
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-security/universe Packages
release v=9.10,o=Ubuntu,a=karmic-security,n=karmic,l=Ubuntu,c=universe
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-security/multiverse Packages
release v=9.10,o=Ubuntu,a=karmic-security,n=karmic,l=Ubuntu,c=multiverse
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-security/restricted Packages
release v=9.10,o=Ubuntu,a=karmic-security,n=karmic,l=Ubuntu,c=restricted
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-security/main Packages
release v=9.10,o=Ubuntu,a=karmic-security,n=karmic,l=Ubuntu,c=main
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-updates/universe Packages
release v=9.10,o=Ubuntu,a=karmic-updates,n=karmic,l=Ubuntu,c=universe
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-updates/multiverse Packages
release v=9.10,o=Ubuntu,a=karmic-updates,n=karmic,l=Ubuntu,c=multiverse
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-updates/restricted Packages
release v=9.10,o=Ubuntu,a=karmic-updates,n=karmic,l=Ubuntu,c=restricted
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic-updates/main Packages
release v=9.10,o=Ubuntu,a=karmic-updates,n=karmic,l=Ubuntu,c=main
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic/universe Translation-zh_CN
500 http://tw.archive.ubuntu.com karmic/universe Packages
release v=9.10,o=Ubuntu,a=karmic,n=karmic,l=Ubuntu,c=universe
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic/multiverse Translation-zh_CN
500 http://tw.archive.ubuntu.com karmic/multiverse Packages
release v=9.10,o=Ubuntu,a=karmic,n=karmic,l=Ubuntu,c=multiverse
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic/restricted Translation-zh_CN
500 http://tw.archive.ubuntu.com karmic/restricted Packages
release v=9.10,o=Ubuntu,a=karmic,n=karmic,l=Ubuntu,c=restricted
origin tw.archive.ubuntu.com
500 http://tw.archive.ubuntu.com karmic/main Translation-zh_CN
500 http://tw.archive.ubuntu.com karmic/main Packages
release v=9.10,o=Ubuntu,a=karmic,n=karmic,l=Ubuntu,c=main
origin tw.archive.ubuntu.com
被锁定(pinned)的软件包:
为什么apt-build依旧是500,没有变成990,示例上应该变成990。http://linuxdesktop.cn/2007/08/01/use-a ... buntu.html
And now, this is dramatical !
你用apt-build来建立自己的软件包,但当你通过apt-get dist-upgrade升级后,你DIY的一个漂亮的软件包被一个官方版本给取代了,真可惜!你可以通过apt-build修改你自制软件的阻塞值来避免这种情况。要想通过apt-build来给你的自制软件包一个较高的优先级,你需要修改 /etc/apt/preferences。 例:
Package: * Pin: release o=apt-buildPin-Priority: 990
这样,你就不用担心一次dist-upgrade会用官方包替换你自己的包了。运行apt-cache policy来检查软件源的优先级。输出的结果格式如下:
[yegle@yegle-laptop]~ $ apt-cache policyPackage Files:100 /var/lib/dpkg/status
release a=now
500 http://ftp2.de.debian.org sid/non-free Packages
release o=Debian,a=unstable,l=Debian,c=non-free origin ftp2.de.debian.org
500 http://ftp2.de.debian.org sid/contrib Packages
release o=Debian,a=unstable,l=Debian,c=contrib
origin ftp2.de.debian.org
500 http://ftp2.de.debian.org sid/main Packages
release o=Debian,a=unstable,l=Debian,c=main
origin ftp2.de.debian.org
990 file: apt-build/main Packages
release o=apt-build,a=apt-build,l=apt-build,c=main
Pinned Packages:
通过软件包阻塞值来解决这个问题很简洁。但是,谨慎对待后续的更新。事实上,如果你决定重建一个被很多软件依赖的lib,并且你不升级它,它将阻止很多软件的升级。因此,多关注你关心的软件的升级情况。
关于apt-build,请教!
-
- 帖子: 146
- 注册时间: 2007-11-12 18:09
- 来自: 四川