Skip to content

Add APT, DNF, and Pacman package managers for Linux#4606

Merged
Gabriel Dufresne (GabrielDuf) merged 7 commits intomainfrom
system-package-manager-Linux
Apr 17, 2026
Merged

Add APT, DNF, and Pacman package managers for Linux#4606
Gabriel Dufresne (GabrielDuf) merged 7 commits intomainfrom
system-package-manager-Linux

Conversation

@GabrielDuf
Copy link
Copy Markdown
Contributor

Summary

Adds native Linux package manager support to UniGetUI via three new managers:

  • APT (apt/apt-cache) — Debian/Ubuntu-based distributions
  • DNF (dnf/dnf5) — RHEL/Fedora-based distributions, with DNF5 (Fedora 41+) discovery
  • Pacman (pacman) — Arch Linux and derivatives

Adds SVG icons for all three managers and registers them in PEInterface.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds native Linux package manager integration to the PackageEngine (APT/DNF/Pacman), wires the managers into PEInterface with basic distro-family detection, and updates elevation behavior/resources to support Linux workflows (including new SVG icons and icon registration).

Changes:

  • Introduces three new PackageEngine manager projects: Apt, Dnf (incl. dnf5 discovery), and Pacman, each with details/operation helpers.
  • Registers the new managers and icons via PEInterface and IconType, and adds corresponding SVG assets.
  • Adds Linux-aware elevation setup (sudo/pkexec discovery + ElevatorArgs) and adjusts operation argument building / admin-rights caching behavior.

Reviewed changes

Copilot reviewed 24 out of 27 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/UniGetUI/Assets/Symbols/pacman.svg Adds Pacman SVG symbol asset
src/UniGetUI/Assets/Symbols/dnf.svg Adds DNF SVG symbol asset
src/UniGetUI/Assets/Symbols/apt.svg Adds APT SVG symbol asset
src/UniGetUI.sln Adds new manager projects to the solution and config mappings
src/UniGetUI.PackageEngine.PackageEngine/UniGetUI.PackageEngine.PEInterface.csproj References new manager projects for non-Windows builds
src/UniGetUI.PackageEngine.PackageEngine/PEInterface.cs Registers Apt/Dnf/Pacman managers and adds Linux distro-family detection
src/UniGetUI.PackageEngine.Operations/SourceOperations.cs Adjusts elevation caching trigger and prepends ElevatorArgs to elevated commands
src/UniGetUI.PackageEngine.Operations/PackageOperations.cs Adjusts elevation caching trigger and prepends ElevatorArgs to elevated commands
src/UniGetUI.PackageEngine.Managers.Pacman/UniGetUI.PackageEngine.Managers.Pacman.csproj New Pacman manager project
src/UniGetUI.PackageEngine.Managers.Pacman/Pacman.cs Implements Pacman manager (discovery, listing, updates, index refresh)
src/UniGetUI.PackageEngine.Managers.Pacman/Helpers/PacmanPkgOperationHelper.cs Pacman operation parameter generation
src/UniGetUI.PackageEngine.Managers.Pacman/Helpers/PacmanPkgDetailsHelper.cs Pacman package details parsing/install location logic
src/UniGetUI.PackageEngine.Managers.Dnf/UniGetUI.PackageEngine.Managers.Dnf.csproj New Dnf manager project
src/UniGetUI.PackageEngine.Managers.Dnf/Helpers/DnfPkgOperationHelper.cs Dnf operation parameter generation
src/UniGetUI.PackageEngine.Managers.Dnf/Helpers/DnfPkgDetailsHelper.cs Dnf package details parsing/install location logic
src/UniGetUI.PackageEngine.Managers.Dnf/Dnf.cs Implements Dnf manager (dnf/dnf5 discovery, listing, updates, index refresh)
src/UniGetUI.PackageEngine.Managers.Apt/UniGetUI.PackageEngine.Managers.Apt.csproj New Apt manager project
src/UniGetUI.PackageEngine.Managers.Apt/Helpers/AptPkgOperationHelper.cs Apt operation parameter generation
src/UniGetUI.PackageEngine.Managers.Apt/Helpers/AptPkgDetailsHelper.cs Apt package details parsing/install location logic
src/UniGetUI.PackageEngine.Managers.Apt/Apt.cs Implements Apt manager (discovery, listing, updates, index refresh)
src/UniGetUI.Interface.Enums/Enums.cs Registers new icon enum values (Apt/Dnf/Pacman)
src/UniGetUI.Core.Tools/Tools.cs Extends admin-rights caching/reset logic for Linux elevators
src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json Adds English strings for manager descriptions (APT/DNF)
src/UniGetUI.Core.Data/CoreData.cs Adds CoreData.ElevatorArgs for elevators needing extra flags (e.g., sudo -A)
src/UniGetUI.Avalonia/Views/Controls/Settings/SettingsPageButton.cs Refactors icon path mapping helper
src/UniGetUI.Avalonia/ViewModels/DialogPages/ManageIgnoredUpdatesViewModel.cs Adds icon name mapping for apt/dnf/pacman
src/UniGetUI.Avalonia/Infrastructure/AvaloniaBootstrapper.cs Adds Linux elevation tool discovery (sudo+askpass preferred, pkexec fallback)
Comments suppressed due to low confidence (3)

src/UniGetUI.PackageEngine.Operations/PackageOperations.cs:122

  • On Linux this now always requests UAC/admin-rights caching whenever elevation is required. Combined with the current CacheUACForCurrentProcess implementation, this can attempt unsupported caching when the elevator is pkexec (or sudo without askpass), causing unnecessary prompts/failures. Consider only requesting caching when the selected elevator supports it (e.g., sudo with askpass/gsudo) or make CacheUACForCurrentProcess a safe no-op for unsupported elevators.
                if (
                    OperatingSystem.IsLinux()
                    || Settings.Get(Settings.K.DoCacheAdminRights)
                    || Settings.Get(Settings.K.DoCacheAdminRightsForBatches)
                )
                {
                    RequestCachingOfUACPrompt();

src/UniGetUI.PackageEngine.Operations/SourceOperations.cs:130

  • Same as PackageOperations: on Linux this always calls RequestCachingOfUACPrompt when elevation is required. If CoreData.ElevatorPath resolves to pkexec (or sudo without askpass), CacheUACForCurrentProcess may not be supported and can trigger extra prompts/failures. Please gate caching requests to elevators that actually support caching, or ensure caching is a safe no-op for pkexec.
                if (
                    OperatingSystem.IsLinux()
                    || Settings.Get(Settings.K.DoCacheAdminRights)
                    || Settings.Get(Settings.K.DoCacheAdminRightsForBatches)
                )
                    RequestCachingOfUACPrompt();

src/UniGetUI.PackageEngine.Operations/SourceOperations.cs:236

  • Same issue as the earlier SourceOperations hunk: Linux always requests caching when elevated, which can break/annoy users when the configured elevator is pkexec or sudo without askpass. Gate caching requests to supported elevators or make caching a no-op for pkexec.
                if (
                    OperatingSystem.IsLinux()
                    || Settings.Get(Settings.K.DoCacheAdminRights)
                    || Settings.Get(Settings.K.DoCacheAdminRightsForBatches)
                )
                    RequestCachingOfUACPrompt();


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/UniGetUI.Core.Tools/Tools.cs Outdated
Comment thread src/UniGetUI.Core.Tools/Tools.cs Outdated
Comment thread src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json
Comment thread src/UniGetUI.PackageEngine.Managers.Pacman/Helpers/PacmanPkgOperationHelper.cs Outdated
Comment thread src/UniGetUI.PackageEngine.Managers.Apt/Helpers/AptPkgDetailsHelper.cs Outdated
Comment thread src/UniGetUI.PackageEngine.Managers.Apt/Helpers/AptPkgOperationHelper.cs Outdated
Comment thread src/UniGetUI.PackageEngine.Managers.Dnf/Helpers/DnfPkgOperationHelper.cs Outdated
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 499cc03 into main Apr 17, 2026
2 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the system-package-manager-Linux branch April 17, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants