18.04 server - unable to locate package redis-server

13,712

Solution 1

As a commenter noted, the universe package was not enabled. Enabling with add-apt-repository did the trick:

sudo add-apt-repository universe

Solution 2

I had the same issue on "Ubuntu 18.04 LTS on Windows 10" and accepted answer doesn't work for me but this answer worked. It might help someone else.

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
Share:
13,712
Bryant
Author by

Bryant

Updated on September 18, 2022

Comments

  • Bryant
    Bryant about 1 year

    I installed a fresh install of 18.04 server. The package redis-server does not seem to be installable. I'm not sure why:

    $ sudo apt install redis-server
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package redis-server
    

    the package doesnt appear to exist:

    $ sudo apt-cache search redis
    miscfiles - Dictionaries and other interesting files
    python-redis - Persistent key-value database with network interface (Python library)
    resource-agents - Cluster Resource Agents
    

    I have run apt update. I'm guessing its missing a repository of packages, but since this is a fresh install, I'm not sure why it would be missing one, or how to fix it.

    root@:/etc/newrelic# sudo apt-get install nri-redis 
    Reading package lists... Done 
    Building dependency tree 
    Reading state information... Done 
    E: Unable to locate package nri-redis
    
  • fkraiem
    fkraiem over 4 years
    The question is not about Ubuntu on Windows.
  • boyukbas
    boyukbas over 4 years
    But I had the same issue. It's eventually Ubuntu. I regret mentioning Windows 10. You are so kind, thank you
  • Kulfy
    Kulfy over 4 years
    @fkraiem Ubuntu WSL and Ubuntu OS uses same repositories for packages.
  • Craig Poole
    Craig Poole over 4 years
    I had to run:sudo apt-get update first