I have a PowerShell Core 7.0.3 on Ubuntu 18.04.
When trying to install NuGet with the following command, it gives the error:
PS /home/adp/Downloads> Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-PackageProvider: Unable to find repository with SourceLocation ''. Use Get-PSRepository to see all available repositories.
The Get-PSRepository command also not working:
PS /home/adp/Downloads> Get-PSRepository
Get-PackageSource: /home/adp/.local/share/powershell/Modules/PowerShellGet/2.1.2/PSModule.psm1:9186
Line |
9186 | … ckageSources = PackageManagement\Get-PackageSource @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to find module providers (PowerShellGet).
And, Get-PackageProvider -ListAvailable returns nothing.
I also tried this solution, and it didn't work.
I'm stuck on the problem, any help is appreciated.