• 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    curl \
47    ffmpeg \
48    git \
49    libcurl4-openssl-dev \
50    libtool \
51    libssl-dev \
52    mlocate \
53    openjdk-8-jdk \
54    openjdk-8-jre-headless \
55    pkg-config \
56    python-dev \
57    python-setuptools \
58    python-virtualenv \
59    python3-dev \
60    python3-setuptools \
61    rsync \
62    sudo \
63    swig \
64    unzip \
65    vim \
66    wget \
67    zip \
68    zlib1g-dev
69
70# populate the database
71updatedb
72
73if [[ "$1" != "--without_cmake" ]]; then
74  apt-get install -y --no-install-recommends \
75    cmake
76fi
77
78
79# Install ca-certificates, and update the certificate store.
80apt-get install -y ca-certificates-java
81update-ca-certificates -f
82
83apt-get clean
84rm -rf /var/lib/apt/lists/*
85