最近电脑坏掉,买新电脑之后,系统是win10,之前的环境又要重新部署。

先用了win10的linux子系统代替之前的cygwin,因为看评测性能是会好一些,也更原生,不至于像cygwin一样转换api这么别扭。

结果先用apt-get装了rust,再装rustup遇到了不少问题,提示的是已安装rust,但卸载重装之后,才提示rustup的env没执行。好不容易装好了。cargo build执行的时候提示SSL证书错误,

error: unable to get packages from source

Caused by:
[60] Peer certificate cannot be authenticated with given CA certificates (SSL certificate problem: unable to get local issuer certificate)

看上去是SSL证书没有,于是找了github的证书下了一份,放在/usr/local/ssl/certs目录下。

https://github.com/bagder/ca-bundle/blob/e9175fec5d0c4d42de24ed6d84a06d504d5e5a09/ca-bundle.crt

结果提示错误:

error: unable to get packages from source

Caused by:
[77] Problem with the SSL CA cert (path? access rights?) (error setting certificate verify locations:
CAfile: /usr/local/ssl/certs/ca-bundle.crt
CApath: /usr/local/ssl/certs)

找了一下,原来有一个专门的包叫ca-certificates,apt-get安装下就ok了。