forked from freegeekchicago/fgc-installscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
291 lines (235 loc) · 10.1 KB
/
install.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#!/bin/bash
### Simple minded install script for
### FreeGeek Chicago by David Eads
### Updates by Brent Bandegar, Dee Newcum, James Slater, Alex Hanson
### Available on FreeGeek` Chicago's github Account at http://git.io/Ool_Aw
### Import DISTRIB_CODENAME and DISTRIB_RELEASE
. /etc/lsb-release
### Get the integer part of $DISTRIB_RELEASE. Bash/test can't handle floating-point numbers.
#DISTRIB_MAJOR_RELEASE=$(echo "scale=0; $DISTRIB_RELEASE/1" | bc) # but bc can, using redirections!
echo "################################"
echo "# FreeGeek Chicago Installer #"
echo "################################"
# Default sources.list already has:
# <releasename> main restricted universe multiverse
# <releasename>-security main restricted universe multiverse
# <releasename>-updates main restricted
# Function that makes a prompt
ask() {
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
prompt="y/N"
default=N
else
prompt="y/n"
default=
fi
# Ask the question
read -p "$1 [$prompt] " REPLY
# Default?
if [ -z "$REPLY" ]; then
REPLY=$default
fi
# Check if the reply is valid
case "$REPLY" in
Y*|y*) return 0 ;;
N*|n*) return 1 ;;
esac
done
}
##################################
# Edits to /etc/apt/sources.list #
##################################
### Disable Source Repos
#
# Check to see if Source repos are set ON and turn OFF
if grep -q "deb-src#" /etc/apt/sources.list; then
echo "# Already disabled source repositories"
else
echo "* Commenting out source repositories -- we don't mirror them locally."
sed -i 's/deb-src /#deb-src# /' /etc/apt/sources.list
fi
### METHOD 1? Add distrib-updates universe multiverse
#
# Figure out if this part of the script has been run already
#grep "${DISTRIB_CODENAME}-updates universe" /etc/apt/sources.list
#if (($? == 1)); then
# echo "* Adding ${DISTRIB_CODENAME} updates line for universe and multiverse"
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
# echo "deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIB_CODENAME}-updates universe multiverse" >> /etc/apt/sources.list
#else
# echo "# Already added universe and multiverse ${DISTRIB_CODENAME}-updates line to sources,"
#fi
### METHOD 2? Add distrib-updates universe multiverse
#
# Figure out if this part of the script has been run already
#if grep -q "${DISTRIB_CODENAME}-updates universe" /etc/apt/sources.list; then
# echo "# Already added universe and multiverse ${DISTRIB_CODENAME}-updates line to sources,"
#else
# echo "* Adding ${DISTRIB_CODENAME} updates line for universe and multiverse"
# cp /etc/apt/sources.list /etc/apt/sources.list.backup
# echo "deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIB_CODENAME}-updates universe multiverse" >> /etc/apt/sources.list
#fi
### Disable and Remove Any Medibuntu Repos
#
if [ -e /etc/apt/sources.list.d/medibuntu.list ]; then
echo "* Removing Medibuntu Repos."
rm /etc/apt/sources.list.d/medibuntu*
else
echo "# Already removed Medibuntu's libdvdcss repo."
fi
### Enable VideoLAN Repo for libdvdcss
#
# In the future call /usr/share/doc/libdvdread4/install-css.sh
#
if [ -e /etc/apt/sources.list.d/videolan.sources.list ]; then
echo "# Already added libdvdcss repo, OK."
else
echo "* Adding VideoLAN's libdvdcss repo, OK."
echo 'deb http://download.videolan.org/pub/debian/stable/ /' >> /etc/apt/sources.list.d/videolan.sources.list
# echo 'deb-src http://download.videolan.org/pub/debian/stable/ /' >> /etc/apt/sources.list.d/videolan.sources.list
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc|sudo apt-key add - libdvdcss
fi
#############################################
# Edit /etc/update-manager/release-upgrades #
#############################################
# Check to see if Source repos are set ON and turn OFF
if grep -q "Prompt=never" /etc/update-manager/release-upgrades; then
echo "# Release Upgrades set to 'never'"
else
echo "* Setting Release Upgrades to 'never'"
sed -i 's/Prompt=lts/Prompt=never/' /etc/update-manager/release-upgrades
fi
#######################
# Add/Remove Packages #
#######################
### Update everything
# We use dist-upgrade to ensure up-to-date kernels are installed
apt-get -y update && apt-get -y dist-upgrade
# Each package should have it's own apt-get line.
# If a package is not found or broken, the whole apt-get line is terminated.
### Packages for Trusty (14.04) ###
###################################
# Auto-accept the MS Core Fonts EULA
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# Add Pepper Flash Player support for Chromium
# Note that this temporarily downloads Chrome, and the plugin uses plugin APIs not provided in Firefox
if [ $(lsb_release -rs) = '14.04' ]; then
echo "* Customizing Trusty packages"
apt-get -y install pepperflashplugin-nonfree &&
update-pepperflashplugin-nonfree --install
apt-get -y install fonts-mgopen
# Kubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' kubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Kubuntu packages."
apt-get -y install software-center
apt-get -y install kdewallpapers
apt-get -y install kubuntu-restricted-extras
apt-get -y autoremove muon muon-updater muon-discover
fi
# Xubuntu 14.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' xubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Trusty-Xubuntu packages."
apt-get -y install xubuntu-restricted-extras
apt-get -y remove gnumeric* abiword*
echo "* Customizing Trusty-Xubuntu settings."
apt-get -y install xmlstarlet
# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-audio-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc cdda://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-audio-cds/command -s "/usr/bin/vlc cdda://"
# Make a system-wide fix so that Audio CDs autoload correctly.
xmlstarlet ed -L -u '/channel/property[@name="autoplay-video-cds"]/property[@name="command"]/@value' -v '/usr/bin/vlc dvd://' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/thunar-volman.xml
### And now do it for the current user.
xfconf-query -c thunar-volman -p /autoplay-video-cds/command -s "/usr/bin/vlc dvd://"
# Make a system-wide fix so that Mac eject key (X86Eject) is mapped to eject (eject -r) function.
xmlstarlet ed -L -s '/channel/property[@name="commands"]/property[@name="default"]' -t elem -n propertyTMP -v "" \
-i //propertyTMP -t attr -n "name" -v "X86Eject" \
-i //propertyTMP -t attr -n "type" -v "string" \
-i //propertyTMP -t attr -n "value" -v "eject" \
-r //propertyTMP -v property \
/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
### And now do it for the current user.
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/default/XF86Eject -n -t string -s "eject"
fi
fi
###
### Packages for Precise (12.04) ###
####################################
if [ $(lsb_release -rs) = '12.04' ]; then
echo "* Customizing Precise packages."
apt-get -y install ttf-mgopen
# Xubuntu 12.04 Specific Packages
if [ $(dpkg-query -W -f='${Status}' xubuntu-desktop 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
echo "* Customizing Precise-Xubuntu packages."
apt-get -y install xubuntu-restricted-extras
apt-get -y remove gnumeric* abiword*
fi
fi
###############
### Packages for All Releases
###############
# Make sure an office suite is installed
apt-get -y install libreoffice
# Add codecs / plugins that most people want
apt-get -y install ubuntu-restricted-extras
apt-get -y install non-free-codecs
apt-get -y install libdvdcss2
# Add design / graphics programs
apt-get -y install gimp
apt-get -y install krita
apt-get -y install inkscape
# Add VLC and mplayer to play all multimedia
apt-get -y install vlc
apt-get -y install mplayer
apt-get -y install totem-mozilla
# Need to justify installation of mplayer and totem-mozilla
# Misc Packages. Need to justify installation of each.
apt-get -y install gcj-jre
apt-get -y install ca-certificates
apt-get -y install chromium-browser
# Also install Chrome?
apt-get -y install hardinfo
# Add spanish language support
apt-get -y install language-pack-es
apt-get -y install language-pack-gnome-es
# Install nonfree firmware for Broadcom wireless cards and TV capture cards
apt-get -y install linux-firmware-nonfree firmware-b43-installer b43-fwcutter
###################################
# Check for Apple as Manufacturer #
###################################
MANUFACTURER=`dmidecode -s system-manufacturer`
if [ "$MANUFACTURER" = "Apple Inc." ]; then
echo "You are using an $MANUFACTURER."
# Remove current apple_ubuntu.sh
if [ -f /usr/local/bin/apple_ubuntu.sh ]; then
echo "## Removing old apple_ubuntu.sh, OK."
rm /usr/local/bin/apple_ubuntu.sh
fi
# Pull fresh install.sh from github, store in /usr/local/bin
echo "## Pulling fresh apple_ubuntu.sh, OK."
wget -qO /usr/local/bin/apple_ubuntu.sh https://raw.githubusercontent.com/freegeekchicago/fgc-installscript/master/apple_ubuntu.sh
# Run install.sh for updates
echo "## Running apple_ubuntu.sh, BYE!"
. /usr/local/bin/apple_ubuntu.sh
fi
######################
# Install and Run sl #
######################
# Ensure installation completed without errors
apt-get -y install sl
echo "Installation complete -- relax, and watch this STEAM LOCOMOTIVE"; sleep 2
/usr/games/sl
##################
# Ask for reboot #
##################
if ask "Do you want to reboot now?" N; then
echo "Rebooting now."
reboot
else
exit 0
fi
## EOF