diff --git a/scripts/init-ubuntu.sh b/scripts/init-ubuntu.sh index 2276badad..bcf1e0180 100755 --- a/scripts/init-ubuntu.sh +++ b/scripts/init-ubuntu.sh @@ -18,14 +18,6 @@ export DEBIAN_FRONTEND=noninteractive readonly ubuntu_codename=$(lsb_release -cs) readonly ubuntu_version=$(lsb_release -rs) -# enable ubuntu proposed for collectd (https://launchpad.net/ubuntu/+source/collectd) -if [[ "${ubuntu_version}" == "22.04" ]]; then - cat </etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list -# Enable Ubuntu proposed archive -deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe -EOF -fi - # hold grub since updating it breaks on some VPS providers. also, dist-upgrade will trigger it apt-mark hold grub* >/dev/null apt-get -o Dpkg::Options::="--force-confdef" update -y @@ -117,17 +109,18 @@ update-grub echo "==> Install collectd" # without this, libnotify4 will install gnome-shell -apt-get install -y libnotify4 --no-install-recommends -if ! apt-get install -y --no-install-recommends libcurl3-gnutls collectd collectd-utils; then - # FQDNLookup is true in default debian config. The box code has a custom collectd.conf that fixes this - echo "Failed to install collectd. Presumably because of http://mailman.verplant.org/pipermail/collectd/2015-March/006491.html" - sed -e 's/^FQDNLookup true/FQDNLookup false/' -i /etc/collectd/collectd.conf -fi +apt-get install -y libnotify4 libcurl3-gnutls --no-install-recommends # https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/1872281 -if [[ "${ubuntu_version}" == "20.04" ]]; then - echo -e "\nLD_PRELOAD=/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so" >> /etc/default/collectd -elif [[ "${ubuntu_version}" == "22.04" ]]; then +if [[ "${ubuntu_version}" == "22.04" ]]; then + readonly launchpad="https://launchpad.net/ubuntu/+source/collectd/5.12.0-9/+build/23189375/+files" + cd /tmp && wget -q "${launchpad}/collectd_5.12.0-9_amd64.deb" "${launchpad}/collectd-utils_5.12.0-9_amd64.deb" "${launchpad}/collectd-core_5.12.0-9_amd64.deb" "${launchpad}/libcollectdclient1_5.12.0-9_amd64.deb" + cd /tmp && apt install -y --no-install-recommends ./libcollectdclient1_5.12.0-9_amd64.deb ./collectd-core_5.12.0-9_amd64.deb ./collectd_5.12.0-9_amd64.deb ./collectd-utils_5.12.0-9_amd64.deb && rm -f /tmp/collectd_*.deb echo -e "\nLD_PRELOAD=/usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.so" >> /etc/default/collectd +else + apt-get install -y --no-install-recommends collectd collectd-utils + if [[ "${ubuntu_version}" == "20.04" ]]; then + echo -e "\nLD_PRELOAD=/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so" >> /etc/default/collectd + fi fi # some hosts like atlantic install ntp which conflicts with timedatectl. https://serverfault.com/questions/1024770/ubuntu-20-04-time-sync-problems-and-possibly-incorrect-status-information