apt-get cannot install specific version listed in apt-cache policy

5,848

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
Share:
5,848

Related videos on Youtube

WheresWardy
Author by

WheresWardy

Updated on September 18, 2022

Comments

  • WheresWardy
    WheresWardy over 1 year

    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
    
    • Jos
      Jos about 9 years
      You could download the .deb file from here and try to install that.
    • WheresWardy
      WheresWardy about 9 years
      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
    WheresWardy about 9 years
    Awesome, programmers brain ignoring colon assuming list I think. Thanks.