Fedora does not package PowerShell, and Microsoft’s Fedora repository won’t give it to you either. Run dnf search powershell on a fresh install and you get three Python helpers. Point dnf at packages.microsoft.com/fedora/45 and the only package in it is the repo definition itself. So the real question is not which Fedora package to install. It is which Microsoft build you borrow, and how that build gets updated afterwards.
The route that works is Microsoft’s RHEL 10 repository, added with dnf5’s config-manager addrepo. Microsoft’s documented first step, rpm -i packages-microsoft-prod.rpm, fails on current Fedora before it installs anything. This guide follows the repo route end to end, then covers the GitHub RPM, the tarball and the .NET global tool, with what each one gets wrong. Everything below was run on Fedora 45 and Fedora 44 in November 2026, with PowerShell 7.7.0 from the repo and the 7.6.10 LTS build.
Fedora ships no PowerShell package
Start by checking what Fedora itself offers, because the answer decides everything after it. The search matches on name and summary, so anything that mentions PowerShell support turns up.
sudo dnf search powershell
Fedora 45 returns three packages, and none of them is a shell. They exist because other software talks to PowerShell, not because Fedora ships it.
Matched fields: name, summary
python3-colcon-powershell.noarch Extension for colcon to provide PowerShell scripts
Matched fields: summary
python3-click-completion.noarch Add automatic completion support for fish, Zsh, Bash and PowerShell to Click
python3-pypsrp.noarch PowerShell Remoting Protocol and WinRM for Python
Microsoft does publish a fedora/45 tree, and its prod.repo answers with HTTP 200, which is why so many people assume it works. Query the tree directly to see what is actually in it.
dnf repoquery --repofrompath=msf45,https://packages.microsoft.com/fedora/45/prod/ --repo=msf45 --nogpgcheck '*'
It holds one package, and that package is the repo installer. Both searches are in the capture below.

The fedora/44 tree carries a few Sysinternals and Defender packages, but no PowerShell package either. PowerShell on Fedora therefore comes from the RHEL builds, even though Microsoft’s install page for RHEL lists versions 10, 9 and 8 only and Fedora appears nowhere on its support list. That works in practice because the package asks very little of the system, as the dependency list further down shows. It also means you are running an unsupported combination, so test upgrades on one machine before you roll them across a fleet.
rpm -i stops at NOKEY
Microsoft’s RHEL install instructions download packages-microsoft-prod.rpm and install it with rpm -i. On Fedora 45 that is where the process ends. The package is signed with a key your RPM database does not know yet, and RPM refuses to install it.
curl -sSLO https://packages.microsoft.com/config/rhel/10/packages-microsoft-prod.rpm
sudo rpm -i packages-microsoft-prod.rpm
The command exits 1 with a NOKEY error for key ID ee4d7792f748182b. A follow-up rpm -ql confirms nothing landed.

What happens when you hand the same file to dnf instead? sudo dnf install ./packages-microsoft-prod.rpm installs it, but the end of its output tells you what it skipped.
Warning: skipped OpenPGP checks for 1 package from repository: @commandline
Complete!
That warning means dnf installed a local file without checking its signature at all, so the error from RPM was hidden rather than solved. Listing the package shows it carries only three files:
/etc/yum.repos.d/microsoft-prod.repo, the repo definition/etc/pki/rpm-gpg/RPM-GPG-KEY-Microsoft, the signing key- a licence file under
/usr/share/licenses
You can add the key and the repo file yourself, with the signature check left on, so the package is not worth installing. The next section does exactly that.
The RHEL 10 repo does the work
Import Microsoft’s signing key into the RPM database first. It is the same key that signed the repo package above, and it also signs the PowerShell RPMs in the repository.
sudo rpm --import https://packages.microsoft.com/keys/microsoft-2025.asc
Then add the repository definition. On Fedora 45 and 44 dnf is dnf5, and its config-manager takes the subcommand form below, because the old --add-repo flag belongs to dnf4.
sudo dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/config/rhel/10/prod.repo
The file lands as /etc/yum.repos.d/prod.repo. That generic name is worth remembering, since you will look for it again when you clean up. Confirm dnf sees the new repository.
dnf repolist
Microsoft Production now sits next to Fedora’s own repositories. Its repo id, packages-microsoft-com-prod, is the name you’ll see in every later dnf transaction, so it’s worth recognising.
repo id repo name
fedora Fedora 45 - x86_64
fedora-cisco-openh264 Fedora 45 openh264 (From Cisco) - x86_64
packages-microsoft-com-prod Microsoft Production
updates Fedora 45 - x86_64 - Updates
Now install the package. The repo file sets repo_gpgcheck=1, so dnf verifies the repository metadata as well as each RPM, and it asks to import the key for that check even though rpm --import already ran. Drop -y on the first run if you would rather approve the key yourself. In a script, keep -y, because without it a non-interactive dnf refuses the key and stops with “Signing key not found”.
sudo dnf install -y powershell
The key prompt and the install look like this on Fedora 45. You’ll see the key import first, then a one-package transaction with nothing else pulled in from Fedora.

Before you accept, check three things in that prompt. They are your only proof that the metadata came from Microsoft.
- The fingerprint reads
AA86F75E427A19DD33346403EE4D7792F748182B. - The user ID is “Microsoft Corporation – General GPG Signer”.
- The key comes from
packages.microsoft.com/keys/.
One package installs, 68 MiB downloaded and 176 MiB on disk. dnf list --showduplicates 'powershell*' shows that the repository carries three package names. Pick one of them, because two of them cannot share a system, as the LTS section shows.
powershell, the current stable linepowershell-lts, the long-term support linepowershell-preview, preview and release candidate builds
Most machines want powershell. The other two are for specific situations, and the rest of this guide assumes the stable package unless it says otherwise.
pwsh lives under /opt
The package installs the whole runtime in /opt/microsoft/powershell/7 and links /usr/bin/pwsh to it. Check the version, the link and the engine’s own view of the system in one go.
pwsh --version
readlink -f /usr/bin/pwsh
pwsh -NoLogo -NoProfile -Command '$PSVersionTable'
PSEdition is Core and the OS line names Fedora, so the engine reads /etc/os-release correctly even though the build targets RHEL.

Why does a RHEL build run on Fedora at all? The answer is in its dependency list. The package bundles its own .NET runtime and asks the system for almost nothing.
rpm -qR powershell
Apart from a shell for its scripts and RPM’s own feature flags, two libraries are all it needs.
/bin/sh
/bin/sh
libicu
openssl-libs
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
libicu and openssl-libs carry no version constraint, so whatever Fedora ships satisfies them and the build keeps installing from one Fedora release to the next. The scriptlet also adds /usr/bin/pwsh to /etc/shells. That line matters later, because chsh only accepts shells listed there.
Measure the startup cost before you put pwsh in a cron job or a git hook. GNU time is not installed on Fedora Cloud, so add it with sudo dnf install time and then time three cold starts.
for i in 1 2 3; do /usr/bin/time -f "%e s %M KB" pwsh -NoLogo -NoProfile -Command exit; done
Each start took about 0.3 seconds and 90 MB of resident memory on the lab VM. The same measurement for bash -c exit came back as 0.02 seconds and 4 MB.
0.31 s 90264 KB
0.29 s 89524 KB
0.29 s 89648 KB
A third of a second is nothing for an interactive shell or for a script that does real work, because the work dominates. It adds up fast in anything called hundreds of times a minute, such as a prompt helper or a monitoring check, so keep those in bash and call PowerShell for the jobs that need its object pipeline.
PSResourceGet asks Microsoft’s registry first
Modules install with Install-PSResource, and the first surprise is the order in which it searches. List the registered repositories.
pwsh -NoLogo -NoProfile -Command 'Get-PSResourceRepository'
Lower priority wins, so the Microsoft Artifact Registry at 40 is asked before the PowerShell Gallery at 50. Note also that the registry is trusted and the Gallery is not.
Name Uri Trusted Prio
rity
---- --- ------- ----
MicrosoftArtifactRegistry https://mcr.microsoft.com/ True 40
PSGallery https://www.powershellgallery.com/api/v2 False 50
What happens when you install a module that only exists on the Gallery? The registry lookup fails loudly, the Gallery lookup succeeds quietly, and you get an error line printed above a module that installed fine. Naming the repository makes the noise go away.
pwsh -NoLogo -NoProfile -Command 'Install-PSResource -Name PSScriptAnalyzer -Repository PSGallery -TrustRepository'
Both runs are below. The first one, without -Repository, printed “Not Found” and still put PSScriptAnalyzer in the home directory.

In a CI job that treats any error output as failure, that first form breaks the build even though the module is there, and you’ll waste time chasing a package that installed fine. So pass -Repository PSGallery in every script, and in interactive use too if you don’t want to learn to ignore red text. User modules go to ~/.local/share/powershell/Modules, the first entry in $env:PSModulePath, which means no sudo is involved and nothing touches /opt. A package upgrade therefore never wipes them.
Profiles follow XDG paths
PowerShell on Linux does not use Documents\PowerShell. Print every profile path it checks.
pwsh -NoLogo -NoProfile -Command '$PROFILE | Format-List * -Force'
The per-user profiles sit in ~/.config/powershell, and the all-users ones live inside the install directory.
AllUsersAllHosts : /opt/microsoft/powershell/7/profile.ps1
AllUsersCurrentHost : /opt/microsoft/powershell/7/Microsoft.PowerShell_profi
le.ps1
CurrentUserAllHosts : /home/kenneth/.config/powershell/profile.ps1
CurrentUserCurrentHost : /home/kenneth/.config/powershell/Microsoft.PowerShell_
profile.ps1
Length : 65
Keep your own settings in the user profile. Files under /opt/microsoft/powershell/7 sit in the package’s directory, and a swap to powershell-lts uses a different directory altogether, so an all-users profile would silently stop loading. The command below creates the user profile with one PSReadLine line in it. Emacs mode is already the default on Linux, so that line only makes the bash-like bindings explicit; replace it with whatever you actually want to change.
pwsh -NoLogo -NoProfile -Command 'New-Item -ItemType File -Path $PROFILE -Force | Out-Null; Add-Content -Path $PROFILE -Value "Set-PSReadLineOption -EditMode Emacs"'
Telemetry is on by default, and PowerShell reads the opt out from the environment when it starts. Setting it inside the profile is too late for that reason. Put the variable in ~/.bashrc instead. That covers every pwsh you start from bash, but not a pwsh login shell, cron jobs or systemd units, which never read that file. For those, set it in /etc/environment or the unit’s Environment= line.
echo 'export POWERSHELL_TELEMETRY_OPTOUT=1' >> ~/.bashrc
Open a new terminal and confirm pwsh inherits the variable. You need a fresh shell because bash reads ~/.bashrc only when it starts.
pwsh -NoLogo -NoProfile -Command '$env:POWERSHELL_TELEMETRY_OPTOUT'
It prints 1. You’ll also notice the interactive banner is a bare version line with no “new version available” notice, because the feature was removed in pull request #28242, which shipped in the 7.7 release candidates and in the LTS line too. On the repo install that is no loss, since dnf upgrade brings new releases anyway. On the tarball and dotnet tool routes further down, it means nothing will ever tell you a release is out.
SELinux leaves pwsh unconfined
There is no SELinux policy for PowerShell, and with Fedora in enforcing mode you do not need one for interactive use. Check the process context while a session runs.
pwsh -NoProfile -Command 'Start-Sleep 5' & sleep 2; ps -eZ | grep pwsh
It runs as unconfined_t, the same domain as your bash session. That’s expected, because child processes inherit the domain of whatever started them.
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 3935 ? 00:00:00 pwsh
sudo ausearch -m avc -ts boot returned no denials after the install and the module install. The picture changes when a confined service runs your script, because pwsh then inherits that service’s domain instead of yours. The usual cases are:
- a web server or CGI handler calling
pwsh - a daemon from a Fedora package that shells out to a script
- a script reading files labelled for another service
In those cases expect AVC denials, and read them before reaching for setenforce 0. The SELinux survival guide for Fedora covers how to read the denials and fix the labels.
pwsh works as a login shell
Because the package registered /usr/bin/pwsh in /etc/shells, chsh accepts it. Keep a second session open while you try this. If the shell fails to start for any reason, that open session is how you switch back.
sudo chsh -s /usr/bin/pwsh "$USER"
getent passwd "$USER"
The last field of the passwd entry is now pwsh. Nothing else in the account changes, so your home directory, groups and sudo rights stay as they were.
kenneth:x:1000:1001::/home/kenneth:/usr/bin/pwsh
Remote commands change with it. ssh host 'command' hands the command string to your login shell, so it is now parsed as PowerShell. From a second machine, this is what still worked:
- plain binaries such as
uname -r - explicit bash calls such as
bash -c "echo hi" scpuploads to the account
Anything written in bash syntax, such as a for loop sent by someone else’s deploy script, now reaches the PowerShell parser instead. That is the part that breaks other people’s automation against your account. Test from another host with a PowerShell expression.
ssh [email protected] 'echo $0; $PSVersionTable.PSVersion'
A PowerShell object comes back over plain SSH. echo $0 printed nothing, because PowerShell does not define $0; the blank line is the one table formatting always adds.
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 7 0
Switch back with sudo chsh -s /bin/bash "$USER", and always do that before removing the package, since a login shell that no longer exists locks the account out of SSH. If you are shopping for a different interactive shell, the roundup of Linux and macOS shells compares the usual alternatives. For PowerShell sessions against Windows machines, PowerShell remoting over SSH is a better tool than a pwsh login shell.
powershell and powershell-lts collide
The repo offers the LTS line as a separate package with its own directory, /opt/microsoft/powershell/7-lts, and its own pwsh-lts command. That looks built for side-by-side installs. It is not.
sudo dnf install -y powershell-lts
The download completes and then the RPM transaction fails on a single file. By then you’ve already pulled 66 MiB for nothing.

Both packages own /usr/bin/pwsh. You can see it before installing anything with dnf repoquery -l powershell-lts, which lists /usr/bin/pwsh and /usr/bin/pwsh-lts side by side. To move to the LTS line, remove one package and install the other.
sudo dnf remove -y powershell
sudo dnf install -y powershell-lts
Check both commands, their links and the owning package once the swap finishes.
pwsh-lts --version
ls -l /usr/bin/pwsh /usr/bin/pwsh-lts
rpm -qf /usr/bin/pwsh
du -sh /opt/microsoft/powershell/7-lts
Both names now point into the LTS directory, and /usr/bin/pwsh belongs to the LTS package. So pwsh-lts is simply a second name for the same binary, not a second install.
PowerShell 7.6.10
lrwxrwxrwx. 1 root root 36 Nov 9 23:39 /usr/bin/pwsh -> /opt/microsoft/powershell/7-lts/pwsh
lrwxrwxrwx. 1 root root 36 Nov 9 23:39 /usr/bin/pwsh-lts -> /opt/microsoft/powershell/7-lts/pwsh
powershell-lts-7.6.10-1.rh.x86_64
171M /opt/microsoft/powershell/7-lts
Your profile and modules in the home directory carry over untouched, because neither package owns them. Pick the LTS package on machines where a minor-version jump in the middle of a support window would hurt, such as a server running scheduled scripts that nobody watches. Use the stable package everywhere else, because it gets new cmdlets and fixes first. The PowerShell 7 vs 5.1 comparison covers what changes between lines if your scripts also run on Windows Server.
The GitHub RPM never updates
Every PowerShell release on GitHub ships an rh.x86_64.rpm, and dnf installs it straight from the URL. This part ran on Fedora 44. Ask the GitHub API for the latest tag instead of typing it.
PS_VER=$(curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep -oP '"tag_name": "v\K[^"]+')
echo "$PS_VER"
It prints the version without the leading v. You’ll reuse $PS_VER in every command below, so a new release needs no edits to them.
7.7.0
Pass the release URL to dnf. It downloads the RPM and installs one package, since libicu and openssl-libs were already on the Fedora 44 Cloud image.
sudo dnf install -y "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VER}/powershell-${PS_VER}-1.rh.x86_64.rpm"
Read the last two lines of the transaction. They carry the same warning the repo package produced earlier, now applied to the whole runtime.
Warning: skipped OpenPGP checks for 1 package from repository: @commandline
Complete!
dnf checked nothing, so do the check yourself on the same file. The SHA256 to compare against is listed under the release’s assets on GitHub.
curl -sSLO "https://github.com/PowerShell/PowerShell/releases/download/v${PS_VER}/powershell-${PS_VER}-1.rh.x86_64.rpm"
sha256sum "powershell-${PS_VER}-1.rh.x86_64.rpm"
rpm -K "powershell-${PS_VER}-1.rh.x86_64.rpm"
The checksum matched the release, and the signature check failed even after importing the 2025 key from the repo route. GitHub RPMs are signed by a different key, Microsoft’s release signing key (ID eb3e94adbe1229cf), which is published as microsoft.asc.

Import that key and run the check again. You only need it once per machine, and the repo route never needs it at all.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
rpm -K "powershell-${PS_VER}-1.rh.x86_64.rpm"
Now rpm -K reports digests signatures OK. On a new machine, run this check before the install rather than after it. The bigger catch shows up weeks later, because dnf records the package as coming from @commandline and has nowhere to look for updates.
sudo dnf upgrade powershell
dnf has nothing to compare the installed package with. It isn’t an error, which is exactly why it’s easy to miss.
Updating and loading repositories:
Last metadata expiration check: 0:01:01 ago on 2026-11-29 22:44:35.
Repositories loaded.
Nothing to do.
Security releases won’t reach that machine until you repeat the download by hand, and with the update notice gone from the banner, nothing will remind you. If you’ve got several hosts on this route, they’ll drift to different versions unless you track releases yourself. dnf info --installed powershell shows the same thing in its “From repository : @commandline” line. Use this route for an air-gapped host where you copy RPMs in anyway, and use the repo everywhere else.
Tarball and dotnet tool skip root
Without sudo you have two options, and neither one updates itself. The tarball is a complete runtime you unpack anywhere. This block pins the LTS line into your home directory.
PS_LTS="7.6.10" # pin: LTS line #https://github.com/PowerShell/PowerShell/releases
mkdir -p ~/.local/opt/pwsh
curl -sSL "https://github.com/PowerShell/PowerShell/releases/download/v${PS_LTS}/powershell-${PS_LTS}-linux-x64.tar.gz" | tar -xz -C ~/.local/opt/pwsh
chmod +x ~/.local/opt/pwsh/pwsh
~/.local/opt/pwsh/pwsh --version
It reports the pinned build and uses 171 MB in the home directory, the same as the LTS RPM.
PowerShell 7.6.10
The .NET global tool is the other no-root route, and it is the one that misbehaves. It needs a .NET SDK first, and on Fedora that package is a root install (sudo dnf install dotnet-sdk-10.0), so the route only skips root on machines where an admin already put the SDK in place. Fedora 45 packages both .NET 10 and .NET 11 SDKs. With dotnet-sdk-10.0 installed, the unversioned install fails, because it pulls the newest PowerShell tool and that build targets .NET 11.

Pinning the LTS version that matches the SDK works. The installer then warns that ~/.dotnet/tools is not on your PATH, so call the tool by its full path until you export the directory.
dotnet tool install --global PowerShell --version 7.6.10 # pin: LTS build that targets .NET 10 #https://github.com/PowerShell/PowerShell/releases
Adding dotnet-sdk-11.0 lets the newest tool install, and then pwsh --version crashed on launch with this exception.
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at System.Management.Automation.Utils.GetPolicySettingFromGPOImpl[T](ConfigScope scope)
Running -Command "1+1" failed with a different exception, looking for a Windows event tracing library (api-ms-win-eventing-provider-l1-1-0.dll). One install, two different crashes, from a tool that installed without complaint. So treat the global tool as something for .NET developers who already manage SDKs and know which one is active. If you use it anyway, keep these in mind:
- pin it to a version you have run
- add
~/.dotnet/toolstoPATH, as the installer suggests - retest after every SDK install, since the newest SDK changes what resolves
Developers who want an editor around any of these routes can pair it with VS Code on Fedora and its PowerShell extension.
Removal leaves the directories
If you switched your login shell, switch it back first, because removing the binary under a login shell locks that account out of SSH. Then remove the package, or powershell-lts if that is the one you kept.
sudo dnf remove -y powershell
dnf frees 176 MiB, but it leaves more behind than you would expect. In order, these were still on the lab machine after the remove:
- Empty
/opt/microsoft/powershell/7and7-ltsdirectories, owned by no package. - Your profile in
~/.config/powershelland modules in~/.local/share/powershell. - The repo file
/etc/yum.repos.d/prod.repo. - The imported Microsoft key, still listed by
rpm -qa gpg-pubkey*.
The home directory items are worth keeping if you plan to reinstall. The repo file is not harmless to leave, because dnf keeps fetching Microsoft’s metadata on every refresh. Delete it, then remove the empty directories with rmdir, which refuses to touch anything that still has files in it. If you never installed the LTS package, rmdir reports that 7-lts does not exist and still removes the rest.
sudo rm /etc/yum.repos.d/prod.repo
sudo rmdir /opt/microsoft/powershell/7 /opt/microsoft/powershell/7-lts /opt/microsoft/powershell /opt/microsoft
Check the name before deleting prod.repo. Other vendors’ repo files can use generic names too, and dnf repolist shows which repo id each file defines. The DNF5 cheat sheet for Fedora has the repo inspection commands if you want to look before you delete.
Pick the route by its update path
Every route ends with the same pwsh binary. What differs is who checks the signature and who brings the next security fix, so compare them on those two columns first.
| Route | Needs root | Signature checked | Updates via dnf | Result in the lab |
|---|---|---|---|---|
RHEL 10 repo, powershell | Yes | Metadata and RPM | Yes | Works on 45 |
RHEL 10 repo, powershell-lts | Yes | Metadata and RPM | Yes | Works, conflicts with powershell |
packages-microsoft-prod.rpm via rpm -i | Yes | Fails (NOKEY) | n/a | Never installs |
| GitHub RPM | Yes | No, unless you run rpm -K with microsoft.asc | No | Works, stays on its version |
Tarball in ~/.local/opt | No | No, compare the SHA256 yourself | No | Works |
| dotnet global tool | Only for the SDK | Left to NuGet | No | Pinned LTS works, newest crashed |
For a workstation or server you manage with dnf, the repo route is the only one that keeps PowerShell patched without you having to remember. The same repo file and package names apply on RHEL 10, Rocky Linux and AlmaLinux, while Debian family machines follow the Ubuntu and Debian install instead. Once pwsh is on the box, the PowerShell cheat sheet is a quick way to learn the cmdlets you will reach for daily.