/
install-ubuntu-dependencies.sh
executable file
·76 lines (73 loc) · 2.24 KB
/
install-ubuntu-dependencies.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
set -eu
distro="$(lsb_release -is)"
release="$(lsb_release -rs)"
here=$(dirname $(readlink -e $0))
common_pkgs='
build-essential
git
libpcap-dev
pkg-config
zlib1g-dev
'
boost_pkgs='
libboost-filesystem-dev
libboost-iostreams-dev
libboost-log-dev
libboost-program-options-dev
libboost-system-dev
'
if [[ "${distro}" = 'Ubuntu' || "${distro}" = 'Kali' ]]; then
while sudo fuser /var/lib/apt/lists/lock; do
sleep 1
done
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y ${common_pkgs}
if [[ "${release}" = '14.04' ]]; then
PYTHON_VERSION='3.6'
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y \
g++-6 \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
python=$(which python${PYTHON_VERSION})
sudo ${python} -m ensurepip
pip=$(which pip${PYTHON_VERSION})
sudo ${pip} install --upgrade pip
sudo ${pip} install --upgrade \
cmake \
meson \
ninja
${here}/install-boost.sh
elif [[ "${release}" = '16.04' ]]; then
sudo apt-get install -y \
${boost_pkgs} \
python3-pip
LC_ALL='C' pip3 install --upgrade \
cmake \
meson \
ninja
elif [[ "${release}" = '18.04' || "${release}" = '20.04' || "${release}" =~ ^20[1,2][0-9]\.[0-9] ]]; then
sudo apt-get install -y \
${boost_pkgs} \
cmake \
meson \
ninja-build
else
echo "Unsupported Ubuntu release ${release}." >&2
exit 2
fi
${here}/install-cpptoml.sh
${here}/install-fuse.sh
${here}/install-fusepp.sh
${here}/install-json.sh
${here}/install-openssl.sh
${here}/install-pcap-plus-plus.sh
else
echo 'This script is supposed to run on Ubuntu systems only.' >&2
exit 3
fi