Browse Source

Use apt instead of apt-get; remove try_install

tags/nilmbuntu-5
Jim Paris 7 years ago
parent
commit
4845ce82bf
1 changed files with 22 additions and 19 deletions
  1. +22
    -19
      customize-inner.sh

+ 22
- 19
customize-inner.sh View File

@@ -8,15 +8,6 @@ fi
set -e set -e
set -x set -x


try_install() {
# try to install packages, but ignore failure
for pkg in "$@"; do
if ! apt-get -y install "$pkg" ; then
echo ---- WARNING: Failed to install package: $pkg
fi
done
}

# Set up live username and hostname # Set up live username and hostname
cat >/etc/casper.conf <<"EOF" cat >/etc/casper.conf <<"EOF"
export USERNAME="ubuntu" export USERNAME="ubuntu"
@@ -31,13 +22,15 @@ cat >/etc/hosts.nilm <<"EOF"
127.0.2.1 nilm.primary 127.0.2.1 nilm.primary
127.0.2.2 nilm.secondary 127.0.2.2 nilm.secondary
EOF EOF
# And copy it for now (although it will get overwritten at boot)
cat /etc/hosts.nilm >> /etc/hosts


# Upgrade packages and remove old kernels # Upgrade packages and remove old kernels
apt-get update
apt-get -y dist-upgrade
apt-get -y --purge autoremove
apt update
apt -y dist-upgrade
apt -y --purge autoremove
for VER in $(ls --sort=version /lib/modules/ | head -n -1) ; do for VER in $(ls --sort=version /lib/modules/ | head -n -1) ; do
apt-get -y --purge remove "linux-.*$VER"
apt -y --purge remove "linux-.*$VER"
done done


# Disable upgrade popups # Disable upgrade popups
@@ -49,10 +42,10 @@ debconf-set-selections <<"EOF"
postfix postfix/mailname string localdomain postfix postfix/mailname string localdomain
postfix postfix/main_mailer_type select Local only postfix postfix/main_mailer_type select Local only
EOF EOF
apt-get -y install postfix
apt -y install postfix


# Required packages # Required packages
apt-get -y install \
apt -y install \
python3 \ python3 \
python2.7 \ python2.7 \
python2.7-dev \ python2.7-dev \
@@ -77,20 +70,29 @@ apt-get -y install \
python-scipy \ python-scipy \
python-daemon python-daemon


# Install other useful but optional stuff
try_install \
# Install other useful stuff
apt -y install \
adb \
avrdude \
chromium-browser \
curl \ curl \
debconf-utils \
devscripts \ devscripts \
dfu-programmer \
dlocate \ dlocate \
emacs \ emacs \
emacs-goodies-el \ emacs-goodies-el \
esptool \
flashrom \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
gcc-avr \
gdb-arm-none-eabi \ gdb-arm-none-eabi \
gddrescue \ gddrescue \
gnuplot \ gnuplot \
help2man \ help2man \
ipython \ ipython \
libnewlib-arm-none-eabi \ libnewlib-arm-none-eabi \
libreoffice \
libstdc++-arm-none-eabi-newlib \ libstdc++-arm-none-eabi-newlib \
texlive \ texlive \
mailutils \ mailutils \
@@ -106,6 +108,7 @@ try_install \
openvpn \ openvpn \
python-matplotlib \ python-matplotlib \
screen \ screen \
sigrok \
silversearcher-ag \ silversearcher-ag \
subversion \ subversion \
tcpdump \ tcpdump \
@@ -113,7 +116,7 @@ try_install \


# Install the packages required for en_US language support # Install the packages required for en_US language support
# This avoids a prompt and package download at first install # This avoids a prompt and package download at first install
try_install $(/usr/bin/check-language-support -l en_US)
apt -y install $(/usr/bin/check-language-support -l en_US)


# Set up timezone to America/New_York for the live CD # Set up timezone to America/New_York for the live CD
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
@@ -129,7 +132,7 @@ chmod +x $DESKTOP/*
# Custom background image (which was already copied in by customize.sh) # Custom background image (which was already copied in by customize.sh)
XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml XML=/etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
BG=/usr/share/xfce4/backdrops/nilmbuntu.png BG=/usr/share/xfce4/backdrops/nilmbuntu.png
apt-get -y install xmlstarlet
apt -y install xmlstarlet
xmlstarlet ed -L -u "//property[@name='image-path']/@value" -v "$BG" $XML xmlstarlet ed -L -u "//property[@name='image-path']/@value" -v "$BG" $XML
xmlstarlet ed -L -u "//property[@name='image-style']/@value" -v "3" $XML xmlstarlet ed -L -u "//property[@name='image-style']/@value" -v "3" $XML




Loading…
Cancel
Save