建议跟据官方指导文档(https://docs.bazel.build/install.html)进行安装Bazel
。像其余开源工具同样,Bazel
官方文档介绍了如何在各类操做系统上安装,也有从源码安装的详细指导。html
Bazel
开发团队并无提供针对Fedora和CentOS的官方包,是Redhat公司一位名叫Vincent Batts
的工程师维护的。工具
使用wget
命令下载yum源配置文件:ui
[root@ecs-d8b6 ~]# wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.rep --2019-06-28 20:16:02-- https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.rep Resolving copr.fedorainfracloud.org (copr.fedorainfracloud.org)... 209.132.184.54 Connecting to copr.fedorainfracloud.org (copr.fedorainfracloud.org)|209.132.184.54|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 314 [text/plain] Saving to: ‘vbatts-bazel-epel-7.rep’ 100%[==================================================================================>] 314 --.-K/s in 0s 2019-06-28 20:16:03 (83.7 MB/s) - ‘vbatts-bazel-epel-7.rep’ saved [314/314] [root@ecs-d8b6 ~]#
下载完的文件存放在当前目录下的vbatts-bazel-epel-7.rep
文件中,你也能够不用wget
下载而手动建立他,文件内容以下:url
[root@ecs-d8b6 ~]# cat vbatts-bazel-epel-7.rep [vbatts-bazel] name=Copr repo for bazel owned by vbatts baseurl=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/epel-7-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/pubkey.gpg repo_gpgcheck=0 enabled=1 enabled_metadata=1
接下来将下载的vbatts-bazel-epel-7.rep
文件拷贝到yum仓库配置目录/etc/yum.repos.d/
:操作系统
[root@ecs-d8b6 ~]# mv vbatts-bazel-epel-7.rep /etc/yum.repos.d/
首先使用yum list bazel
命令来查看上一步新加的yum配置文件是否已经生效:code
[root@ecs-d8b6 ~]# yum list bazel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.nus.edu.sg * epel: mirrors.aliyun.com * extras: mirror.nus.edu.sg * updates: mirror.nus.edu.sg Available Packages bazel.x86_64 0.27.0-7.el7 vbatts-bazel
能够看到,已经有一个0.27版本的能够安装了。htm
使用yum install bazel
命令来安装:ip
[root@ecs-d8b6 ~]# yum install bazel
安装过程当中分提示安装所需的依赖包,按操做提示便可完成安装。开发
安装完成后,bazel
会自动存放在/usr/bin/
目录下:文档
[root@ecs-d8b6 ~]# which bazel /usr/bin/bazel