如何使用Debian软件包分发CA证书?

将您自己的CA证书添加到Ubuntu的常用方法是:

cp cert.pem /usr/local/share/ca-certificates update-ca-certificates 

我想使用Debian软件包分发我的CA证书,但是/usr/local/是对软件包的限制(和lintian投诉,软件中心谴责我的软件包是低质量的)。 那么使用Debian包装的标准方法是什么? 我试着偷看ca-certificates-java ,但我无法理解它在做什么。

看来the_Seppi和bodhi.zazen是正确的:唯一干净的方法是使用维护者脚本来做这件事。 来自/usr/share/doc/ca-certificates/README.Debian

 How to install local CA certificates ------------------------------------------------------------------ ... If you want to prepare a local package of your certificates, you should depend on ca-certificates, install the PEM files into /usr/local/share/ca-certificates/ as above and call 'update-ca-certificates' in the package's postinst, and should call 'update-ca-certificates --fresh' in the package's postrm. An example source package for building a local CA certificate package, using ca-certificates (>= 20130119) (since it uses triggers) can be found in /usr/share/doc/ca-certificates/examples/ca-certificates-local/. The README file in the above directory has step-by-step instructions for building a local CA certificate package. 

示例包有一个Makefile ,可直接将文件安装到/usr/local/share/ca-certificates

但是,在/usr/local安装文件的Debian策略根本不是通过直接或使用维护者脚本来完成的(参见第1.2节,第9章 )。

我认为可接受的妥协是使用脚本,并放置链接而不是复制它们。 这样,最终用户仍然可以跟踪/usr/local/内容来自何处。

应该将update-ca-certificates-fresh到触发器列表 (如上面引用的最后一段中所述),而不是调用具有不同参数的update-ca-certificates-fresh ,允许证书与任何其他挂起的证书更新一起处理:

 echo 'activate update-ca-certificates-fresh' >> debian/package-name.triggers