Skip to content

Instantly share code, notes, and snippets.

@amboxer21
Created July 16, 2022 23:01
Show Gist options
  • Save amboxer21/5de6afb9e8cfc09108b2392c1a14bbdb to your computer and use it in GitHub Desktop.
Save amboxer21/5de6afb9e8cfc09108b2392c1a14bbdb to your computer and use it in GitHub Desktop.
A script to remove gentoo atoms that have no omitted version. Should prevent the system removing a package that has no alternative version.
#!/bin/bash
# A script to remove gentoo atoms that have no omitted version. Should prevent the system removing a package that has no alternative version.
readarray -t pkg < <(emerge -av --pretend --quiet --depclean | awk '/^[a-z].*:\s[0-9].*/{if ($NF != "none") { gsub(":","-"); print $1$2 } }')
sudo emerge -av --unmerge $(echo ${pkg[*]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment