5 # Post-installation reduction. (Answer "no" to GRUB question.)
6 dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > list_white_unsorted
7 echo 'ifupdown' >> list_white_unsorted
8 echo 'isc-dhcp-client' >> list_white_unsorted
9 sort list_white_unsorted > list_white
10 dpkg-query -Wf '${Package}\n' > list_all_packages
11 sort list_all_packages > foo
12 mv foo list_all_packages
13 comm -3 list_all_packages list_white > list_black
14 apt-mark auto `cat list_black`
15 echo 'APT::AutoRemove::RecommendsImportant "false";' > /etc/apt/apt.conf.d/99mindeps
16 echo 'APT::AutoRemove::SuggestsImportant "false";' >> /etc/apt/apt.conf.d/99mindeps
17 DEBIAN_FRONTEND=noninteractive apt-get -y --purge autoremove
18 rm list_all_packages list_white_unsorted list_white list_black
19 echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99mindeps
20 echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf.d/99mindeps
22 # Package management config, system upgrade.
23 echo 'deb http://ftp.debian.org/debian/ jessie main contrib non-free' > /etc/apt/sources.list
24 echo 'deb http://security.debian.org/ jessie/updates main contrib non-free' >> /etc/apt/sources.list
25 echo 'deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free' >> /etc/apt/sources.list
28 apt-get -y dist-upgrade
30 # Don't clear boot messages on start up.
31 sed -i 's/^TTYVTDisallocate=yes$/TTYVTDisallocate=no/g' /etc/systemd/system/getty.target.wants/getty\@tty1.service
34 DEBIAN_FRONTEND=nointeractive apt-get -y install locales console-setup
35 echo 'ACTIVE_CONSOLES="/dev/tty[1-6]"' > /etc/default/console-setup
36 echo 'CHARMAP="UTF-8"' >> /etc/default/console-setup
37 echo 'CODESET="Lat15"' >> /etc/default/console-setup
38 echo 'FONTFACE="TerminusBold"' >> /etc/default/console-setup
39 echo 'FONTSIZE="8x16"' >> /etc/default/console-setup
40 echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
42 echo 'export LC_ALL="en_US.UTF-8"' >> /etc/profile
44 # Clone git repository.
45 apt-get -y install ca-certificates
46 apt-get -y install git
47 git clone http://github.com/plomlompom/config
50 # Add user. Remove old user's config/ if it exists.
51 useradd -m -s /bin/bash plom
52 rm -rf /home/plom/config
53 su - plom -c 'git clone http://github.com/plomlompom/config /home/plom/config'
54 su plom -c /home/plom/config/symlink.sh
56 # Set up window system.
57 apt-get -y install xserver-xorg xinit xterm i3 i3status dmenu
60 apt-get -y install man-db manpages less
63 apt-get -y install vim
68 # Set password for user.