目录
error: failed to run custom build command for `openssl-sys v0.9.63`
failed to fetch `https://github.com/rust-lang/crates.io-index`
Blocking waiting for file lock on package cache
error: failed to run custom build command for `openssl-sys v0.9.72`
环境
$ cat /proc/version
Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
$ rustc -V
rustc 1.59.0 (9d1b2106e 2022-02-23)
cargo -V
cargo 1.59.0 (49d8809dc 2022-02-10)
运行
error: failed to run custom build command for `openssl-sys v0.9.63`
实际错误提示需要安装openssl 或 libssl-dev,安装本地ssl最后本地版本为1.x.
仔细看会的提示让安装pkg-config
# on Ubuntu WSL solved it for me
sudo apt install pkg-config
failed to fetch `https://github.com/rust-lang/crates.io-index`
需要修改Rust Crates Registry 源
vim ~/.cargo/.crates2.json
{"installs":{"mdbook 0.4.9 (registry+https://mirrors.ustc.edu.cn/crates.io-index)"...
需要修改为registry+https://mirrors.ustc.edu.cn/crates.io-index
USTC Mirror Help — USTC Mirror Help 文档http://mirrors.ustc.edu.cn/help/index.html
Blocking waiting for file lock on package cache
无论是用vscode或是clion编译时一直卡着
rm -rf ~/.cargo/.package-cache