2017-08-18 1 views
0

Laut Handbuch:Warum höhere Priorität für mein Repository funktioniert nicht in Apt?

 A note of caution: the keyword used here is "origin" which can be 
     used to match a hostname. The following record will assign a high 
     priority to all versions available from the server identified by 
     the hostname "ftp.de.debian.org" 

      Package: * 
      Pin: origin "ftp.de.debian.org" 
      Pin-Priority: 999 

Quelle Link: http://manpages.ubuntu.com/manpages/zesty/man5/apt_preferences.5.html

Es gibt meine Ausgänge:

apt Präferenz ist:

# more /etc/apt/preferences.d/default_source_list.pref 
Package: * 
Pin: origin "ubuntu-repository.youseeu.com" 
Pin-Priority: 999 

Politik für Paket mysql- Server:

# apt-cache policy mysql-server 
mysql-server: 
    Installed: (none) 
    Candidate: 5.5.57-0ubuntu0.14.04.1 
    Version table: 
    5.5.57-0ubuntu0.14.04.1 0 
     500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 
     500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages 
     999 https://ubuntu-repository.youseeu.com/ysu_ubuntu14/ trusty/main amd64 Packages 
    5.5.35+dfsg-1ubuntu1 0 
     500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 

Prüfung, wie es funktioniert:

# apt-get install -d mysql-server 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
The following extra packages will be installed: 
    libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 
    libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common 
    mysql-server-5.5 mysql-server-core-5.5 perl perl-base perl-modules 
Suggested packages: 
    libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl 
    libsql-statement-perl libipc-sharedcache-perl tinyca mailx perl-doc 
    libterm-readline-gnu-perl libterm-readline-perl-perl libb-lint-perl 
    libcpanplus-dist-build-perl libcpanplus-perl libfile-checktree-perl 
    liblog-message-perl libobject-accessor-perl 
The following NEW packages will be installed: 
    libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 
    libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common 
    mysql-server mysql-server-5.5 mysql-server-core-5.5 
The following packages will be upgraded: 
    perl perl-base perl-modules 
3 upgraded, 12 newly installed, 0 to remove and 195 not upgraded. 
Need to get 16.1 MB of archives. 
After this operation, 97.2 MB of additional disk space will be used. 
Do you want to continue? [Y/n] y 
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main perl amd64 5.18.2-2ubuntu1.1 [2,648 kB] 
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main perl-base amd64 5.18.2-2ubuntu1.1 [1,146 kB] 
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main perl-modules all 5.18.2-2ubuntu1.1 [2,673 kB] 
Get:4 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libaio1 amd64 0.3.109-4 [6,364 B] 
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-common all 5.5.57-0ubuntu0.14.04.1 [13.0 kB] 
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libmysqlclient18 amd64 5.5.57-0ubuntu0.14.04.1 [596 kB] 
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libdbi-perl amd64 1.630-1 [879 kB] 
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main libdbd-mysql-perl amd64 4.025-1ubuntu0.1 [87.6 kB] 
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libterm-readkey-perl amd64 2.31-1 [27.4 kB] 
Get:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client-core-5.5 amd64 5.5.57-0ubuntu0.14.04.1 [707 kB] 
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-client-5.5 amd64 5.5.57-0ubuntu0.14.04.1 [1,588 kB] 
Get:12 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-core-5.5 amd64 5.5.57-0ubuntu0.14.04.1 [3,766 kB] 
Get:13 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server-5.5 amd64 5.5.57-0ubuntu0.14.04.1 [1,866 kB] 
Get:14 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main libhtml-template-perl all 2.95-1 [65.5 kB] 
Get:15 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main mysql-server all 5.5.57-0ubuntu0.14.04.1 [11.3 kB] 
Fetched 16.1 MB in 0s (21.1 MB/s) 
Download complete and in download only mode 

Kontrollpolitik:

# apt-cache policy | head -n 20 
Package files: 
100 /var/lib/dpkg/status 
    release a=now 
999 https://ubuntu-repository.youseeu.com/ysu_ubuntu14/ trusty/main amd64 Packages 
    release o=ysu_ubuntu14 trusty,a=trusty,n=trusty,l=ysu_ubuntu14 trusty,c=main 
    origin ubuntu-repository.youseeu.com 
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe Translation-en 
500 http://security.ubuntu.com/ubuntu/ trusty-security/main Translation-en 
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages 
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe 
    origin security.ubuntu.com 
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages 
    release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main 
    origin security.ubuntu.com 
500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe Translation-en 
500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main Translation-en 
500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages 
    release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe 
    origin us-east-2.ec2.archive.ubuntu.com 
500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 

Also, warum Paket mysql-Server wurde von der Host-us-east-2.ec2.archive heruntergeladen. ubuntu.com?

Warum höhere Priorität für mein Repository ubuntu-repository.youseeu.com nicht funktioniert?

Antwort

0

Mehrere Instanzen derselben Version eines Pakets kann verfügbar sein, wenn die sources.list (5) Dateiverweise auf mehr als eine Quelle enthält. In diesem Fall lädt apt-get die in früheste Instanz der sources.list (5) -Datei herunter. Die APT-Einstellungen haben keinen Einfluss auf die Auswahl der Instanz, nur die Wahl der Version. Quelle Link (Ihr Link): http://manpages.ubuntu.com/manpages/zesty/man5/apt_preferences.5.html

Also zuerst apt Suche verfügbare Versionen:

apt-cache policy mysql-server mysql-Server: Installiert: (keine) Candidate: 5.5. 57-0ubuntu0.14.04.1 Version Tabelle:

5.5.57-0ubuntu0.14.04.1 0 
    500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 
    500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages 
    999 https://ubuntu-repository.youseeu.com/ysu_ubuntu14/ trusty/main amd64 Packages 
5.5.35+dfsg-1ubuntu1 0 
    500 http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages 

Version 5.5.57 in 3 Quellen gefunden ignorierten Priorität nach:

In diesem Fall apt-get-Downloads die Instanz frühestens in der sources.list aufgelistet (5) Datei. Die APT-Einstellungen haben keinen Einfluss auf die Auswahl der Instanz, nur die Wahl der Version.

Verwandte Themen