0

I'm trying to install imagemagick package from my own repository. Here is my step-by-step:

I created apt repository using reprepro utility with conf:

Origin: custom-repo.s3.amazonaws.com
Label: custom-repo.s3.amazonaws.com
Codename: precise
Components: main
Architectures: i386 amd64
Description: Custom APT Repository
SignWith: 12312312
DebOverride: override.precise
DscOverride: override.precise

On the target instance I added this custom repo to /etc/apt/sources.list.d/custom.list:

deb     http://custom-repo.s3.amazonaws.com precise main

And changed APT preferences (/etc/apt/preferences):

Package: *
Pin: release o=custom-repo.s3.amazonaws.com
Pin-Priority: 999

Here is APT policy (after update):

imagemagick:
  Installed: (none)
  Candidate: 8:6.6.9.7-5ubuntu3.3
  Version table:
     8:6.6.9.7-5ubuntu3.3 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
        999 http://custom-repo.s3.amazonaws.com/ precise/main amd64 Packages
     8:6.6.9.7-5ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Now I'm trying to install imagemagick package from my own repository (but it's installed from archive.ubuntu.com):

apt-get install imagemagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  imagemagick-doc autotrace cups-bsd lpr lprng enscript ffmpeg gimp gnuplot grads hp2xx html2ps libwmf-bin mplayer povray radiance sane-utils texlive-base-bin transfig xdg-utils ufraw-batch
The following NEW packages will be installed:
  imagemagick
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 49.2 kB of archives.
After this operation, 213 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main imagemagick amd64 8:6.6.9.7-5ubuntu3.3 [49.2 kB]
Fetched 49.2 kB in 0s (96.8 kB/s)
Selecting previously unselected package imagemagick.
(Reading database ... 94215 files and directories currently installed.)
Unpacking imagemagick (from .../imagemagick_8%3a6.6.9.7-5ubuntu3.3_amd64.deb) ...
Processing triggers for man-db ...
Setting up imagemagick (8:6.6.9.7-5ubuntu3.3) ...
symydo
  • 3
  • 1

1 Answers1

1

I think the short answer is, apt selects package versions, not repositories.

apt_preferences(1) says that apt will "install the highest priority version", which it is doing. But it doesn't say that it will install it from the highest-priority repository. It may be just picking the first repository in its list that has that version.

As far as apt knows, the package version in your repository and archive.ubuntu.com are the same, since they have the same version numbers. If they are the same, then there's really no issue, except that you can't test your repository. If they're not the same, then you have a packaging problem and should change the version number in your package.

If you do want to force apt to use your repository in order to test it, you might try raising the Pin-Priority of imagemagick to more than 1000. That triggers different logic in apt that will force it to downgrade a package, and it might make it choose your repository. Or, install a different version of the package in your repository, and see if apt picks the right one.

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
  • Unfortunately Pin-Priority 1000+ doesn't change anything in my case - apt still uses original repository address. I'll consider using different version is the best option in my case. Thank you. – symydo Jul 29 '14 at 08:05