Skip to content

Instantly share code, notes, and snippets.

@ralphm
Last active June 16, 2023 12:29
Show Gist options
  • Save ralphm/1326498c474aaacf0a12f9e569dac863 to your computer and use it in GitHub Desktop.
Save ralphm/1326498c474aaacf0a12f9e569dac863 to your computer and use it in GitHub Desktop.
#/bin/sh
#
# This explicitly installs Netdata Agent version 1.40.0-2-nightly on Debian based systems.
#
apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances netdata=1.40.0-2-nightly 2>/dev/null | awk '/Depends: netdata/{print $2"=1.40.0-2-nightly"}' | sort | uniq | xargs apt-get -y --allow-downgrades install
chown -f -R netdata:netdata /var/{lib,cache,run,log}/netdata
systemctl restart netdata
@vkalintiris
Copy link

Drive-by comment: I don't know if xargs is available by default. If not, we could save this to a variable with | tr '\n' ' ' and expand it in apt-get.

@ralphm
Copy link
Author

ralphm commented Jun 16, 2023

This work-around for the problematic 1.40.0-6-nightly:

  • Installs or downgrades netdata version 1.40.0-2-nightly and its plugin dependencies
  • Fixes the permissions for all directories the Agent should access
  • Restarts the Agent through systemd.

@DarkDau
Copy link

DarkDau commented Jun 16, 2023

suggested downgrade to 1.40.02 worked
thanks
Your incident -handling is great! 🖐️

@ralphm
Copy link
Author

ralphm commented Jun 16, 2023

People having quoting issues because of the awk command may try this as a replacement:

grep 'Depends: netdata' | cut -d' ' -f 4 | sed 's/$/=1.40.0-2-nightly/'

@olegueret
Copy link

Notice that he "Depends: " part is language dependent: in my Ubuntu 22.04 configured in Spanish I had to replace it with "Depende: "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment