官方文档:https://docs.bazel.build/versions/master/install-ubuntu.html

我没有使用二进制的安装方法,以下是二进制的安装方法:

Installing using binary installer

Step 1: Install required packages

First, install the prerequisites: pkg-configzipg++zlib1g-devunzip, and python.

sudo apt-get install pkg-config zip g++ zlib1g-dev unzip python

Step 2: Download Bazel

Next, download the Bazel binary installer named bazel-<version>-installer-linux-x86_64.sh from the Bazel releases page on GitHub.

Step 3: Run the installer

Run the Bazel installer as follows:

chmod +x bazel-<version>-installer-linux-x86_64.sh
./bazel-<version>-installer-linux-x86_64.sh --user

The --user flag installs Bazel to the $HOME/bin directory on your system and sets the .bazelrc path to $HOME/.bazelrc. Use the --help command to see additional installation options.

Step 4: Set up your environment

If you ran the Bazel installer with the --user flag as above, the Bazel executable is installed in your $HOME/bin directory. It’s a good idea to add this directory to your default paths, as follows:

export PATH="$PATH:$HOME/bin"

You can also add this command to your ~/.bashrc file.

我使用的是这种方法:

Using Bazel custom APT repository

Step 1: Install the JDK

Install JDK 8:

sudo apt-get install openjdk-8-jdk

On Ubuntu 14.04 LTS you must use a PPA:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer # Ubuntu14.04需要安装PPA

Step 2: Add Bazel distribution URI as a package source

Note: This is a one-time setup step.

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -

If you want to install the testing version of Bazel, replace stable with testing.

Step 3: Install and update Bazel

sudo apt-get update && sudo apt-get install bazel

Once installed, you can upgrade to a newer version of Bazel with the following command:

sudo apt-get install --only-upgrade bazel

Ubuntu16.04如何安装bazel?的更多相关文章

  1. Ubuntu16.04编译安装php

    #Ubuntu16.04编译安装php Ubuntu16.04上面搭建基于Nginx的php服务.Nginx使用apt直接安装的. sudo apt install nginx php的安装部署步骤主 ...

  2. Ubuntu16.04下安装数据库oracle客户端

    在Ubuntu16.04下安装oracle数据库客户端,使Django项目连接到远程Oracle数据库. 1.下载oracle客户端安装包: 进入官网http://www.oracle.com/tec ...

  3. Ubuntu16.04下安装redis

    Ubuntu16.04下安装redis 保证网络畅通,选定好下载工作路径,执行以下命令下载redis-3.2.6: sudo wget http://download.redis.io/release ...

  4. ubuntu16.04 python3 安装selenium及环境配置

    环境 ubuntu16.04 python3 安装selenium sudo pip3 install seleium 默认安装完是支持firefox,但是更新得太慢对于较新的firefox已经不支持 ...

  5. Ubuntu16.04下安装Hadoop

    一.记录理由 刚开始只是想要学习怎么使用Hive的.想着安装应该很简单,没想到花了整整一天的时间来安装,为了避免下次犯同样的错误,特此记录. 二.安装Hadoop 网上教你怎么安装Hadoop的文章有 ...

  6. docker学习笔记(一)—— ubuntu16.04下安装docker

    docker学习笔记(一)—— ubuntu16.04下安装docker 原创 2018年03月01日 14:53:00 标签: docker / ubuntu 1682 本文开发环境为Ubuntu ...

  7. SLAM+语音机器人DIY系列:(二)ROS入门——3.在ubuntu16.04中安装ROS kinetic

    摘要 ROS机器人操作系统在机器人应用领域很流行,依托代码开源和模块间协作等特性,给机器人开发者带来了很大的方便.我们的机器人“miiboo”中的大部分程序也采用ROS进行开发,所以本文就重点对ROS ...

  8. 通过Anaconda在Ubuntu16.04上安装 TensorFlow(GPU版本)

    一. 安装环境 Ubuntu16.04.3 LST GPU: GeForce GTX1070 Python: 3.5 CUDA Toolkit 8.0 GA1 (Sept 2016) cuDNN v6 ...

  9. ubuntu16.04下安装artoolkit5

    目前对AR技术的常见理解就是CV(Computer Vision)+CG(Computer Graphic).CV的方法很多,简单些比如FREAK+ICP(ARToolKit中的NFT),复杂些就是S ...

随机推荐

  1. Simple Random Sampling|representative sample|probability sampling|simple random sampling with replacement| simple random sampling without replacement|Random-Number Tables

    1.2 Simple Random Sampling Census, :全部信息 Sampling: 抽样方式: representative sample:有偏向,研究者选择自己觉得有代表性的sam ...

  2. Fastjson主要接口和类库说明

    2.主要的使用入口 Fastjson API入口类是com.alibaba.fastjson.JSON,常用的序列化操作都可以在JSON类上的静态方法直接完成. public static final ...

  3. MRP执行计划列表(禁用)

    1.最直接的方法,推进方法 2.比较麻烦的方法

  4. Spring Boot Admin最佳实践

    本文不进行Spring Boot Admin入门知识点说明 在Spring Boot Actuator中提供很多像health.metrics等实时监控接口,可以方便我们随时跟踪服务的性能指标.Spr ...

  5. Iterator迭代器解决[为何禁止在foreach内增删]

    迭代器的应用场景: 1.对集合进行增加删除,禁止使用foreach,循环的动态操作2.倒序遍历3.遍历循环 步入正题:为何禁止在foreach内进行增删? 先看一下代码: /**         *  ...

  6. TensorFlow 介绍

    关于 TensorFlow TensorFlow™ 是一个采用数据流图(data flow graphs),用于数值计算的开源软件库.节点(Nodes)在图中表示数学操作,图中的线(edges)则表示 ...

  7. 3dmax2016卸载/安装失败/如何彻底卸载清除干净3dmax2016注册表和文件的方法

    3dmax2016提示安装未完成,某些产品无法安装该怎样解决呢?一些朋友在win7或者win10系统下安装3dmax2016失败提示3dmax2016安装未完成,某些产品无法安装,也有时候想重新安装3 ...

  8. webpack中使用ECharts

    npm安装ECharts 引入ECharts 通过 npm 上安装的 ECharts 和 zrender 会放在node_modules目录下.可以直接在项目代码中 require('echarts' ...

  9. FPGA开平方的实现

    3种方法: 1.JPL近似的实现方法 `timescale 1ns / 1ps )( clk, syn_rst, dataa, datab, ampout); input clk; :] dataa; ...

  10. java 二分法查找原理

    二分法查找原理: 1.只要低位下标不大于高位下标,就进行二分查找(步骤1-3) 2.先在有序的数组中对半查找中间的坐标,如果中标和要查找的下标相等时,找到目标数,那二分结束. 3.如果步骤2没有找到, ...