Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ save_package_state() {
print_step "Saving current package state..."
local pkg_state_file="$HOME/.draphyOS-packages-before"

# Save list of currently installed packages (just package names, no versions)
dnf list installed 2>/dev/null | tail -n +2 | awk '{print $1}' | cut -d'.' -f1 | sort -u > "$pkg_state_file"
# Use rpm -qa for reliable package listing (works across DNF4/DNF5)
# Output just package names without version/arch
rpm -qa --qf '%{NAME}\n' 2>/dev/null | sort -u > "$pkg_state_file"

if [ -f "$pkg_state_file" ]; then
if [ -f "$pkg_state_file" ] && [ -s "$pkg_state_file" ]; then
local count
count=$(wc -l < "$pkg_state_file")
print_success "Package state saved ($count packages)"
Expand Down
4 changes: 2 additions & 2 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ remove_packages() {
if [[ "$response" =~ ^[Yy]$ ]]; then
print_step "Calculating packages to remove..."

# Get current installed packages
# Get current installed packages (using rpm for consistency with install)
local current_pkgs
current_pkgs=$(mktemp)
dnf list installed 2>/dev/null | tail -n +2 | awk '{print $1}' | cut -d'.' -f1 | sort -u > "$current_pkgs"
rpm -qa --qf '%{NAME}\n' 2>/dev/null | sort -u > "$current_pkgs"

# Find packages that were added (in current but not in before)
local pkgs_to_remove
Expand Down