尝试在 Ubuntu 14.04 服务器 LTS 上安装 Varnish

尝试在 Ubuntu 14.04 服务器 LTS 上安装 Varnish

我尝试在 Ubuntu 14.04 上安装 Varnish 缓存并得到以下信息:

The following packages have unmet dependencies:
 varnish : Depends: libjemalloc1 (>=2.1.1) but it is not installable
           Depends: gcc but it is not installable
E: Unable to correct problems, you have held broken packages.

我是这样做的:

apt-get install apt-transport-https
apt-get install curl
curl https://repo.varnish-cache.org/ubuntu/GPG-key.txt | apt-key add -
echo "deb https://repo.varnish-cache.org/ubuntu/ trusty varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list
apt-get update
apt-get install varnish

我刚刚在 VMWare VM 中安装了 Trusty,以便对 Nginx 和 Varnish 进行一些测试。有什么补救措施吗?

输出自apt-cache policy libjemalloc1

libjemalloc1:
   Installed: (none)
   Candidate: (none)
   Version table:

输出相同

apt-cache policy gcc

答案1

libjemalloc1在宇宙存储库中

sudo apt-add-repository universe

gcc在主存储库中

sudo apt-add-repository main

在那之后

sudo apt-get update
sudo apt-get install varnish

相关内容