V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
hzqim
V2EX  ›  Linux

Debian 里源的优先级是怎么规定的?

  •  
  •   hzqim · 2015-09-20 22:55:33 +08:00 · 5186 次点击
    这是一个创建于 3141 天前的主题,其中的信息可能已经有所发展或是发生改变。
    apt-get install 可以通过指定包的版本号或者发行版来安装软件。
    但 sources.list 包含多个源地址的时候,在不指定包的版本号,发行版等信息的情况下, apt 是怎么决定从那个仓库里安装软件的?

    谢谢解答!
    9 条回复    2015-09-21 20:55:42 +08:00
    choury
        1
    choury  
       2015-09-20 22:59:55 +08:00 via Android   ❤️ 2
    哪个新装哪个
    HMSQQbA
        2
    HMSQQbA  
       2015-09-20 23:05:51 +08:00 via Android   ❤️ 2
    1. 混源死的快
    2. Pin-Priority
    3. dmo 这种流氓源通过修改 epoch 版本数字,使自己的包看上去比官方的新。
    xfspace
        3
    xfspace  
       2015-09-20 23:29:37 +08:00 via Android   ❤️ 1
    我可以问下...阿里云 ECS
    我把 sources.list 换成 ustc 的了,特么还是先在 Aliyun 下载!
    hzqim
        4
    hzqim  
    OP
       2015-09-20 23:33:04 +08:00
    @HMSQQbA 主要是添加了 dotdeb 的源。
    ryd994
        5
    ryd994  
       2015-09-21 00:15:06 +08:00   ❤️ 2
    你可以搜 apt priority
    zjqzxc
        6
    zjqzxc  
       2015-09-21 00:26:32 +08:00   ❤️ 1
    似乎好像是匹配版本号最新的。。。前几天 debian 配置了 kali 的源, kali 内核 3.18 ,原装 debian 3.16 的内核。它提示更新我也没在意,就把 debian 更新成 kali 了。。。到现在 kali 都没删干净。。
    choury
        7
    choury  
       2015-09-21 00:34:15 +08:00   ❤️ 2
    @xfspace 你应该看下 /etc/apt/sources.list.d/ 这个目录下有没有东西
    HMSQQbA
        8
    HMSQQbA  
       2015-09-21 01:17:19 +08:00   ❤️ 2
    @hzqim 看 man apt_preferences ,有详细说明

    · Never downgrade unless the priority of an available version exceeds
    1000. ("Downgrading" is installing a less recent version of a package
    in place of a more recent version. Note that none of APT's default
    priorities exceeds 1000; such high priorities can only be set in the
    preferences file. Note also that downgrading a package can be risky.)

    · Install the highest priority version.

    · If two or more versions have the same priority, install the most recent
    one (that is, the one with the higher version number ).

    · If two or more versions have the same priority and version number but
    either the packages differ in some of their metadata or the --reinstall
    option is given, install the uninstalled one.

    1. 看版本号
    2. 看 pin-priority
    3&4. 如果版本号和优先级都相同,用其它规则

    参考 http://forum.ubuntu.org.cn/viewtopic.php?f=15&t=472760

    在一个包已安装的情况下,再安装版本号和优先级完全相同的一个包时
    指定了 --reinstall ? 是 --> 安装新包, 否 --> 下一步
    元数据完全相同?是 --> 不安装(保留旧包),否 --> 安装新包
    (credit to [email protected] )
    xfspace
        9
    xfspace  
       2015-09-21 20:55:42 +08:00
    @choury 没有,空的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   935 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:05 · PVG 06:05 · LAX 15:05 · JFK 18:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.