18.04 服务器 - 无法找到包 redis-server

Bry*_*ant 5 server package-management apt redis software-installation

我安装了全新安装的 18.04 服务器。该软件包redis-server似乎无法安装。我不确定为什么:

$ sudo apt install redis-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package redis-server
Run Code Online (Sandbox Code Playgroud)

该包似乎不存在:

$ 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
Run Code Online (Sandbox Code Playgroud)

我已经跑了apt update。我猜它缺少一个软件包存储库,但由于这是一个全新安装,我不确定为什么会丢失一个,或者如何修复它。

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
Run Code Online (Sandbox Code Playgroud)

Bry*_*ant 8

正如评论者指出的那样,该universe软件包未启用。使用 add-apt-repository 启用可以解决问题:

sudo add-apt-repository universe

  • 我必须先运行:`sudo apt-get update` (5认同)

boy*_*bas 7

我在“Windows 10 上的 Ubuntu 18.04 LTS”上遇到了同样的问题,接受的答案对我不起作用,但这个答案有效。它可能对其他人有帮助。

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
Run Code Online (Sandbox Code Playgroud)