@@ -102,6 +102,9 @@ make install-world
102
102
cd ..
103
103
rm -rf postgresql-$POSTGRES_VERSION *
104
104
105
+ # Add 'vagrant' role
106
+ su -c ' createuser vagrant -s' postgres
107
+
105
108
# Initialize postgres DB
106
109
useradd -p postgres postgres
107
110
mkdir -p /var/pgsql/data
@@ -133,11 +136,12 @@ make install
133
136
cd utils
134
137
yes | sudo ./install_server.sh
135
138
cd ../..
136
- rm -rf redis-$REDIS_VERSION
139
+ rm -rf ~ / redis-$REDIS_VERSION
137
140
138
141
ES_VERSION=" 0.20.5"
139
142
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION .deb
140
143
dpkg -i elasticsearch-$ES_VERSION .deb
144
+ rm -rf ~ /elasticsearch-$ES_VERSION .deb
141
145
142
146
# Memcached
143
147
apt-get -y install memcached
@@ -190,8 +194,55 @@ apt-get -y autoremove
190
194
# Set locale
191
195
echo ' LC_ALL="en_US.UTF-8"' >> /etc/default/locale
192
196
193
- # Add 'vagrant' role
194
- su -c ' createuser vagrant -s' postgres
197
+ echo " ==> Installed packages before cleanup"
198
+ dpkg --get-selections | grep -v deinstall
199
+
200
+ # Remove some packages to get a minimal install
201
+ echo " ==> Removing all linux kernels except the currrent one"
202
+ dpkg --list | awk ' { print $2 }' | grep ' linux-image-3.*-generic' | grep -v $( uname -r) | xargs apt-get -y purge
203
+ echo " ==> Removing linux source"
204
+ dpkg --list | awk ' { print $2 }' | grep linux-source | xargs apt-get -y purge
205
+ echo " ==> Removing development packages"
206
+ dpkg --list | awk ' { print $2 }' | grep -- ' -dev$' | xargs apt-get -y purge
207
+ echo " ==> Removing documentation"
208
+ dpkg --list | awk ' { print $2 }' | grep -- ' -doc$' | xargs apt-get -y purge
209
+ echo " ==> Removing development tools"
210
+ # dpkg --list | grep -i compiler | awk '{ print $2 }' | xargs apt-get -y purge
211
+ # apt-get -y purge cpp gcc g++
212
+ apt-get -y purge build-essential
213
+ echo " ==> Removing default system Ruby"
214
+ apt-get -y purge ruby ri doc
215
+ echo " ==> Removing default system Python"
216
+ apt-get -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
217
+ echo " ==> Removing X11 libraries"
218
+ apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6
219
+ echo " ==> Removing obsolete networking components"
220
+ apt-get -y purge ppp pppconfig pppoeconf
221
+ echo " ==> Removing other oddities"
222
+ apt-get -y purge popularity-contest installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
223
+
224
+ # Clean up the apt cache
225
+ apt-get -y autoremove --purge
226
+ apt-get -y autoclean
227
+ apt-get -y clean
228
+
229
+ # Clean up orphaned packages with deborphan
230
+ apt-get -y install deborphan
231
+ while [ -n " $( deborphan --guess-all --libdevel) " ]; do
232
+ deborphan --guess-all --libdevel | xargs apt-get -y purge
233
+ done
234
+ apt-get -y purge deborphan dialog
235
+
236
+ echo " ==> Removing man pages"
237
+ rm -rf /usr/share/man/*
238
+ echo " ==> Removing APT files"
239
+ find /var/lib/apt -type f | xargs rm -f
240
+ echo " ==> Removing anything in /usr/src"
241
+ rm -rf /usr/src/*
242
+ echo " ==> Removing any docs"
243
+ rm -rf /usr/share/doc/*
244
+ echo " ==> Removing caches"
245
+ find /var/cache -type f -exec rm -rf {} \;
195
246
196
247
echo " Adding a 2 sec delay to the interface up, to make the dhclient happy"
197
248
echo " pre-up sleep 2" >> /etc/network/interfaces
0 commit comments