github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/images/app-go-dev/scripts/cleanup.sh (about)

     1  #!/bin/sh -eux
     2  
     3  # Disable automatic udev rules for network interfaces in Ubuntu,
     4  # source: http://6.ptmc.org/164/
     5  rm -f /etc/udev/rules.d/70-persistent-net.rules;
     6  mkdir -p /etc/udev/rules.d/70-persistent-net.rules;
     7  rm -f /lib/udev/rules.d/75-persistent-net-generator.rules;
     8  rm -rf /dev/.udev/ /var/lib/dhcp3/*;
     9  
    10  # Delete all Linux headers
    11  dpkg --list \
    12    | awk '{ print $2 }' \
    13    | grep 'linux-headers' \
    14    | xargs apt-get -y purge;
    15  
    16  # Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but
    17  # keeps the current kernel and does not touch the virtual packages,
    18  # e.g. 'linux-image-generic', etc.
    19  dpkg --list \
    20      | awk '{ print $2 }' \
    21      | grep 'linux-image-3.*-generic' \
    22      | grep -v `uname -r` \
    23      | xargs apt-get -y purge;
    24  
    25  # Delete Linux source
    26  dpkg --list \
    27      | awk '{ print $2 }' \
    28      | grep linux-source \
    29      | xargs apt-get -y purge;
    30  
    31  # Delete development packages
    32  dpkg --list \
    33      | awk '{ print $2 }' \
    34      | grep -- '-dev$' \
    35      | xargs apt-get -y purge;
    36  
    37  # Delete compilers and other development tools
    38  apt-get -y purge cpp gcc g++;
    39  
    40  # Delete X11 libraries
    41  apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6;
    42  
    43  # Delete obsolete networking
    44  apt-get -y purge ppp pppconfig pppoeconf;
    45  
    46  # Delete oddities
    47  apt-get -y purge popularity-contest;
    48  
    49  apt-get -y autoremove;
    50  apt-get -y clean;
    51  
    52  rm -f VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.?;