debian varnish service is masked 解决办法
https://www.yangshengliang.com/kaiyuan-shijie/linux-shijie/1133.html
不要使用 sudo 进行 install varnish,使用普通用户权限即可
# ubuntu 18.04下安装 Varnish 4.0.3-5 版本
参考如下设置,先配置 deb 的软件仓库
https://packagecloud.io/varnishcache/varnish40/install#manual-deb
如果是按照如下脚本后的执行配置可能不对
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish40/script.deb.sh | sudo bash
需要修改在/etc/apt/sources.list.d/varnishcache_varnish40.list
下的配置如下,区别主要在于 ubuntu 的软件版本号设置的不对,不应该设置为当前的ubuntu版本(bionic),否则会出现找不到安装包的问题,设置为trusty
就可以
12.04 LTS Precise Pangolin ubuntu/precise
14.04 LTS Trusty Tahr ubuntu/trusty
16.04 LTS Xenial Xerus ubuntu/xenial
18.04 LTS Bionic Beaver ubuntu/bionic
注意如下的ubuntu
和 trusty
# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/varnishcache/varnish40
deb https://packagecloud.io/varnishcache/varnish40/ubuntu/ trusty main
deb-src https://packagecloud.io/varnishcache/varnish40/ubuntu/ trusty main
需要安装 4.0.4-5
//注意安装顺序
apt-get install libvarnishapi1=4.0.3-5~trusty
apt-get install varnish=4.0.3-5~trusty
apt-get install libvarnishapi-dev=4.0.3-5~trusty
https://packagecloud.io/varnishcache/varnish40/packages/ubuntu/trusty/libvarnishapi1_4.0.3-5~trusty_amd64.deb
https://packagecloud.io/varnishcache/varnish40/packages/ubuntu/trusty/varnish_4.0.3-5~trusty_amd64.deb
https://packagecloud.io/varnishcache/varnish40/packages/ubuntu/trusty/libvarnishapi-dev_4.0.3-5~trusty_amd64.deb
4.1
//注意安装顺序
sudo apt-get install libvarnishapi1=4.1.3-1~trusty
sudo apt-get install varnish=4.1.3-1~trusty
sudo apt-get install libvarnishapi-dev=4.1.3-1~trusty
https://packagecloud.io/varnishcache/varnish41/packages/ubuntu/trusty/libvarnishapi1_4.1.3-1~trusty_amd64.deb
https://packagecloud.io/varnishcache/varnish41/packages/ubuntu/trusty/varnish_4.1.3-1~trusty_amd64.deb
https://packagecloud.io/varnishcache/varnish41/packages/ubuntu/trusty/libvarnishapi-dev_4.1.3-1~trusty_amd64.deb