-
Notifications
You must be signed in to change notification settings - Fork 1
/
ubuntu18.10.sh
executable file
·166 lines (142 loc) · 6.27 KB
/
ubuntu18.10.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash
set -x
set -e
set -u
if [ $UID != "0" ]; then
echo "This script must be run as root" >&2
exit 1
fi
add-apt-repository multiverse
apt-get -y update
apt-get -y install git curl wget apt-transport-https ca-certificates software-properties-common
RELEASE_CODENAME=$(lsb_release -cs)
# As of 11/15/18, this ppa doesn't support 18.10
#if [ ! -e /etc/apt/sources.list.d/recoll-backports-ubuntu-recoll-1_15-on-$RELEASE_CODENAME.list ]; then
# add-apt-repository -y ppa:recoll-backports/recoll-1.15-on
# apt-get -y update
#fi
if [ ! -e /etc/apt/sources.list.d/insync.list ]; then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ACCAF35C
echo 'deb http://apt.insynchq.com/ubuntu '$RELEASE_CODENAME' non-free contrib' > /etc/apt/sources.list.d/insync.list
apt-get -y update
fi
if [ ! -e /etc/apt/sources.list.d/docker.list ]; then
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# As of 11/15/18, this repo doesn't support 18.10
#echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
apt-get -y update
fi
if [ ! -e /etc/apt/sources.list.d/nvidia-docker.list ]; then
curl -fsSL https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
# As of 11/15/18, this repo doesn't support 18.10, use the 18.04 repo
#distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
#curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list > /etc/apt/sources.list.d/nvidia-docker.list
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu18.04/nvidia-docker.list > /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
fi
apt-get -y update
apt-get -y dist-upgrade
GO_PKGS="golang"
MY_TOOLS="alarm-clock-applet anki lyx meld gimp git-gui gitk htop httpie ifstat inkscape iotop molly-guard nethogs nmap linux-tools-generic ncdu csvkit python3-csvkit whois lm-sensors texlive-full insync insync-nautilus xclip parallel p7zip-rar p7zip-full vim vim-doc vim-gnome vim-gtk virtualbox apt-file dos2unix dvipng tree vagrant valgrind vlc ubuntu-unity-desktop net-tools"
MISC="tmux byobu screen ssh"
DEV_PACKAGES="bison libboost-all-dev build-essential bzr ccache clang cmake g++ gcc git-svn gradle kcachegrind libcurl4-openssl-dev libopencv-dev libssl-dev libtool mercurial openjdk-8-dbg openjdk-8-doc openjdk-8-jdk openjdk-8-source openjdk-11-dbg openjdk-11-doc openjdk-11-jdk openjdk-11-source zlib1g-dev default-jdk doxygen gawk"
PYTHON2_BASIC="python python-all python-all-dev python-dev python-pip python-setuptools python-wheel python-virtualenv ipython"
PYTHON3_BASIC="python3 python3-all python3-all-dev python3-dev python3-pip python3-setuptools python3-wheel python3-virtualenv ipython3 virtualenv"
RECOLL_PACKAGES="recoll antiword catdoc djvulibre-bin libimage-exiftool-perl libwpd-tools pstotext python3-mutagen python-chm python-mutagen p7zip-rar p7zip-full unrar unrtf untex wv"
R_PACKAGES="r-base r-base-dev r-cran-boot r-cran-class r-cran-cluster r-cran-codetools r-cran-foreign r-cran-ggplot2 r-cran-kernsmooth r-cran-lattice r-cran-mass r-cran-matrix r-cran-mcmcpack r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rjags r-cran-rodbc r-cran-rpart r-cran-spatial r-cran-survival"
DEV_TOOLS="octave subversion"
SYSTEM_PACKAGES="apt-transport-https autofs smartmontools ttf-bitstream-vera ttf-dejavu ubuntu-restricted-extras unattended-upgrades bash-completion lxd"
DOCKER="docker-ce nvidia-docker2"
UNITY="ubuntu-unity-desktop xserver-xorg-input-synaptics"
apt-get install --fix-broken \
$GO_PKGS \
$MY_TOOLS \
$MISC \
$DEV_PACKAGES \
$PYTHON2_BASIC \
$PYTHON3_BASIC \
$RECOLL_PACKAGES \
$R_PACKAGES \
$DEV_TOOLS \
$SYSTEM_PACKAGES \
$DOCKER \
$UNITY
snap install intellij-idea-ultimate --classic
if ! grep -q "^/net\s*-hosts$" /etc/auto.master; then
sed -i -e 's/^#\/net -hosts$/\/net -hosts/' /etc/auto.master
service autofs restart
fi
sudo snap install chromium chromium-ffmpeg
if ! [ -e /usr/bin/rstudio ]; then
latest_r_studio_url=$(wget -q -O- http://www.rstudio.com/ide/download/desktop | grep -o -P 'https?://.*\.rstudio\.org/rstudio-.*-amd64\.deb' | tail -1)
wget -O /tmp/rstudio.deb "$latest_r_studio_url"
dpkg -i /tmp/rstudio.deb || true
apt-get -fy install
fi
if ! dpkg -l google-talkplugin; then
wget -O /tmp/google-talkplugin_current_amd64.deb https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb
dpkg -i /tmp/google-talkplugin_current_amd64.deb || true
apt-get -fy install
fi
# Install python epub module for recoll indexing of epub files
if ! [ -e /usr/local/lib/python2.7/dist-packages/epub ]; then
pip install epub
fi
if ! [ -e /usr/local/lib/python3.5/dist-packages/epub ]; then
pip3 install epub
fi
# Install python rarfile module for recoll indexing of rar files
if ! [ -e /usr/local/lib/python2.7/dist-packages/rarfile.py ]; then
pip install rarfile
fi
if ! [ -e /usr/local/lib/python3.5/dist-packages/rarfile.py ]; then
pip3 install rarfile
fi
# The next three file modifications are to raise the ridicuously low file descriptor limit.
if ! grep 'root hard nofile' /etc/security/limits.conf; then
cat >> /etc/security/limits.conf << EOS
* soft nofile 100000
* hard nofile 100000
root soft nofile 100000
root hard nofile 100000
EOS
fi
if ! grep '^session required pam_limits.so$' /etc/pam.d/common-session; then
cat >> /etc/pam.d/common-session << EOS
session required pam_limits.so
EOS
fi
if ! grep '^session required pam_limits.so$' /etc/pam.d/common-session-noninteractive; then
cat >> /etc/pam.d/common-session-noninteractive << EOS
session required pam_limits.so
EOS
fi
if ! grep -q '^fs.inotify.max_queued_events = 1048576$' /etc/sysctl.conf; then
cat >> /etc/sysctl.conf << EOS
fs.inotify.max_queued_events = 1048576
fs.inotify.max_user_instances = 1048576
fs.inotify.max_user_watches = 1048576
EOS
sysctl -p
fi
if ! grep -q '^GRUB_TERMINAL=console$' /etc/default/grub; then
cat >> /etc/default/grub << EOS
GRUB_TERMINAL=console
EOS
update-grub
fi
if ! grep -q '"default-runtime": "nvidia",' /etc/docker/daemon.json; then
cat > /etc/docker/daemon.json << EOS
{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
}
}
EOS
service docker restart
fi