• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ==============================================================================
16#
17# Usage:
18#     ./install_deb_packages [--without_cmake]
19# Pass --without_cmake to prevent cmake from being installed with apt-get
20
21set -e
22ubuntu_version=$(cat /etc/issue | grep -i ubuntu | awk '{print $2}' | \
23  awk -F'.' '{print $1}')
24
25if [[ "$1" != "" ]] && [[ "$1" != "--without_cmake" ]]; then
26  echo "Unknown argument '$1'"
27  exit 1
28fi
29
30# Install dependencies from ubuntu deb repository.
31apt-key adv --keyserver keyserver.ubuntu.com --recv 084ECFC5828AB726
32apt-get update
33
34if [[ "$ubuntu_version" == "14" ]]; then
35  # specifically for trusty linked from ffmpeg.org
36  add-apt-repository -y ppa:mc3man/trusty-media
37  apt-get update
38  apt-get dist-upgrade -y
39fi
40
41## TODO(yifeif) remove ffmpeg once ffmpeg is removed from contrib
42apt-get install -y --no-install-recommends \
43    autoconf \
44    automake \
45    build-essential \
46    clang-format-3.8 \
47    curl \
48    ffmpeg \
49    git \
50    libcurl4-openssl-dev \
51    libtool \
52    libssl-dev \
53    mlocate \
54    openjdk-8-jdk \
55    openjdk-8-jre-headless \
56    pkg-config \
57    python-dev \
58    python-setuptools \
59    python-virtualenv \
60    python3-dev \
61    python3-setuptools \
62    rsync \
63    sudo \
64    swig \
65    unzip \
66    vim \
67    wget \
68    zip \
69    zlib1g-dev
70
71# populate the database
72updatedb
73
74if [[ "$1" != "--without_cmake" ]]; then
75  apt-get install -y --no-install-recommends \
76    cmake
77fi
78
79
80# Install ca-certificates, and update the certificate store.
81apt-get install -y ca-certificates-java
82update-ca-certificates -f
83
84apt-get clean
85rm -rf /var/lib/apt/lists/*
86