Last active
August 17, 2024 07:57
-
-
Save aleskxyz/b1b8caf2eeae28fb320bceb26a360350 to your computer and use it in GitHub Desktop.
Revisions
-
aleskxyz revised this gist
Jun 4, 2024 . 1 changed file with 3 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,8 @@ rpm_list="" package_list="" for id in $(yum --noplugins history list all 2> /dev/null | grep -v System | sed 's/^ *//;s/ *| */|/g' | grep -E "^[0-9]+\|" | awk -F '|' '$4 == "Install" || $4 ~ /I/' | cut -d '|' -f1); do result=$(yum --noplugins history info $id 2> /dev/null | awk '/Packages Altered/{flag=1; next} flag' | awk '$1 == "Install"' | awk '{print $2}') if [ -n "$result" ]; then rpm_list+="$result"$'\n' fi @@ -38,4 +19,4 @@ done <<< "$rpm_list" package_list=$(echo "$package_list" | sort | uniq | sed '/^$/d') echo "$package_list" -
aleskxyz revised this gist
Jun 4, 2024 . 1 changed file with 22 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,27 @@ #!/bin/bash if command -v dnf &> /dev/null; then PM="dnf" elif command -v yum &> /dev/null; then PM="yum" else echo "Neither yum nor dnf found." exit 1 fi if [ "$PM" == "dnf" ]; then history_list_cmd="dnf --noplugins history list" history_info_cmd="dnf --noplugins history info" else history_list_cmd="yum --noplugins history list all" history_info_cmd="yum --noplugins history info" fi rpm_list="" package_list="" for id in $($history_list_cmd 2> /dev/null | grep -v System | sed 's/^ *//;s/ *| */|/g' | grep -E "^[0-9]+\|" | awk -F '|' '$4 == "Install" || $4 ~ /I/' | cut -d '|' -f1); do result=$($history_info_cmd $id 2> /dev/null | awk '/Packages Altered/{flag=1; next} flag' | awk '$1 == "Install"' | awk '{print $2}') if [ -n "$result" ]; then rpm_list+="$result"$'\n' fi @@ -19,4 +38,4 @@ done <<< "$rpm_list" package_list=$(echo "$package_list" | sort | uniq | sed '/^$/d') echo "$package_list" -
aleskxyz revised this gist
Jun 4, 2024 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,8 @@ rpm_list="" package_list="" for id in $(yum --noplugins history list all 2> /dev/null | grep -v System | sed 's/^ *//;s/ *| */|/g' | grep -E "^[0-9]+\|" | awk -F '|' '$4 == "Install" || $4 ~ /I/' | cut -d '|' -f1); do result=$(yum --noplugins history info $id 2> /dev/null | awk '/Packages Altered/{flag=1; next} flag' | awk '$1 == "Install"' | awk '{print $2}') if [ -n "$result" ]; then rpm_list+="$result"$'\n' fi @@ -21,4 +19,4 @@ done <<< "$rpm_list" package_list=$(echo "$package_list" | sort | uniq | sed '/^$/d') echo "$package_list" -
aleskxyz revised this gist
Jun 3, 2024 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ #!/bin/bash rpm_list="" package_list="" -
aleskxyz created this gist
Jun 3, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ rpm_list="" package_list="" for id in $(yum history list all 2> /dev/null | grep -v System | sed 's/^ *//;s/ *| */|/g' | grep -E "^[0-9]+\|" | awk -F '|' '$4 == "Install" || $4 ~ /I/' | cut -d '|' -f1); do result=$(yum history info $id 2> /dev/null | awk '/Packages Altered/{flag=1; next} flag' | awk '$1 == "Install"' | awk '{print $2}') if [ -n "$result" ]; then rpm_list+="$result"$'\n' fi done rpm_list=$(echo "$rpm_list" | sed '/^$/d') while IFS= read -r package; do package_name=$(rpm -q --queryformat '%{NAME}\n' "$package" 2>/dev/null) if [ $? -eq 0 ]; then package_list+="$package_name"$'\n' fi done <<< "$rpm_list" package_list=$(echo "$package_list" | sort | uniq | sed '/^$/d') echo "$package_list"