Skip to content

Instantly share code, notes, and snippets.

@nogweii
Created December 3, 2013 00:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogweii/7761427 to your computer and use it in GitHub Desktop.
Save nogweii/7761427 to your computer and use it in GitHub Desktop.
Automatically install -debuginfo packages for all installed packages in OpenSUSE (tested on 13.1)
#!/bin/sh
zypper packages -i 2>/dev/null | cut -d'|' -f3 | sort -u | sed -n 's/^ \([a-z0-9-]*\)\s\+/\1-debuginfo/p' | xargs zypper search -u -t package | cut -d'|' -f2 | sed -n 's/^\s//;s/\s\+$//gp' | tail -n+2 | xargs sudo zypper install
@poltpolt
Copy link

poltpolt commented Jul 9, 2021

thanks for that

@ubernostrom
Copy link

FYI, this misses packages because the regex ^ \([a-z0-9-]*\)\s\+ doesn't match packages with + or _ in their names.

For example it misses libstc++6 and libopenssl1_0_0.

Here's a version with that fixed:

zypper packages -i 2>/dev/null | tail -n +5 | cut -d'|' -f3 | sort -u | sed -n 's/^ \([^ ]*\)\s\+/\1-debuginfo/p' | xargs zypper search -u -t package | tail -n +5 | cut -d'|' -f2 | sed -n 's/^\s//;s/\s\+$//gp' | xargs sudo zypper install

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Mar 24, 2024

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