1. 问题
powerline fonts 官方提供的安装命令,是从 github 上下载文件,但服务器无法连上 github ,因此要从国内 git 源下载文件并本地安装
2. 分析官方安装命令
gitee 同步的官方原地址:gitee地址
其中官方的安装命令说明如下
# clone -- 将 github 上的文件克隆(下载)到本地
git clone https://github.com/powerline/fonts.git --depth=1
# install -- 运行 /fonts 目录下的 install.sh 脚本进行安装
cd fonts
./install.sh
# clean-up a bit -- 安装完成后,清理下载的文件
cd ..
rm -rf fonts
3. 修改官方命令为国内gitee地址
对 clone 步骤中 git 路径进行修改,更改为 gitee 的地址
copy这里的地址,http格式
git clone +上面copy的地址 --depth=1
4. 实际操作
-
克隆(下载)文件 clone
在 /opt 目录下存放clone的文件cd /opt
执行clone指令
git clone https://gitee.com/ace_astra/Powerline_fonts.git --depth=1
-
安装
进入 下载文件中 /font 目录cd Powerline_fonts/fonts
运行安装脚本
./install.sh
-
清理
删除克隆(下载)的文件cd /opt sudo rm -rf Powerline_fonts/
5. 后记
- 安装的时候发现还缺少两个字体文件,这两个文件在 powerline 源的 font/ 目录下
直接使用curl
命令下载这两个字体,并移动到 centos 的字体目录中/usr/local/share/fonts