6

I'm trying to install a particular version of redis-server from a third-party repo using apt-get, that's listed in apt-cache policy, but cannot be installed. For example:

$ apt-cache policy redis-server
redis-server:
  Installed: (none)
  Candidate: 2:2.8.19-1chl1~trusty1
  Version table:
     2:2.8.19-1chl1~trusty1 0
        500 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/ trusty/main amd64 Packages
     2:2.8.4-2 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

$ apt-get install redis-server=2.8.19-1chl1~trusty1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.8.19-1chl1~trusty1' for 'redis-server' was not found

If I try and install redis-server without picking a package version, it tries to install the version I've tried to specify:

$ apt-get -s install redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libjemalloc1 redis-tools
The following NEW packages will be installed:
  libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 81 not upgraded.
Inst libjemalloc1 (3.6.0-1chl1~trusty1 redis-server:14.04/trusty [amd64])
Inst redis-tools (2:2.8.19-1chl1~trusty1 redis-server:14.04/trusty [amd64])
Inst redis-server (2:2.8.19-1chl1~trusty1 redis-server:14.04/trusty [amd64])
Conf libjemalloc1 (3.6.0-1chl1~trusty1 redis-server:14.04/trusty [amd64])
Conf redis-tools (2:2.8.19-1chl1~trusty1 redis-server:14.04/trusty [amd64])
Conf redis-server (2:2.8.19-1chl1~trusty1 redis-server:14.04/trusty [amd64])

Trying various forms of the version number doesn't seem to work:

$ apt-get install redis-server=2.8.19-1chl1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.8.19-1chl1' for 'redis-server' was not found

$ apt-get install redis-server=2.8.19-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.8.19-1' for 'redis-server' was not found

$ apt-get install redis-server=2.8.19
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.8.19' for 'redis-server' was not found
  • You could download the .deb file from here and try to install that. – Jos Feb 16 '15 at 11:46
  • I'm relying on apt because this is part of a Chef cookbook, and would like to rely on the tooling for 'pinning' to a version. apt-get does work because it'll install redis-server without the version requirement. – WheresWardy Feb 16 '15 at 11:51
5

The 2: is part of the version number. Don't forget to add it when specifying the version:

apt-get install redis-server=2:2.8.19-1chl1~trusty1
  • 2
    Awesome, programmers brain ignoring colon assuming list I think. Thanks. – WheresWardy Feb 16 '15 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.