Follow instructions at https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1804
Using Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-36-generic x86_64)
Successful install.
saares@vmaf:~$ wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
saares@vmaf:~$ sudo dpkg -i packages-microsoft-prod.deb
Selecting previously unselected package packages-microsoft-prod.
(Reading database ... 102542 files and directories currently installed.)
Preparing to unpack packages-microsoft-prod.deb ...
Unpacking packages-microsoft-prod (1.0-ubuntu18.04.1) ...
Setting up packages-microsoft-prod (1.0-ubuntu18.04.1) ...
saares@vmaf:~$ sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 https://packages.microsoft.com/ubuntu/18.04/prod bionic InRelease [2,846 B]
Get:5 https://packages.microsoft.com/ubuntu/18.04/prod bionic/main amd64 Packages [26.9 kB]
Fetched 29.8 kB in 1s (49.9 kB/s)
Reading package lists... Done
saares@vmaf:~$ sudo apt-get install -y powershell
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
powershell : Depends: liblttng-ust0 but it is not installable
E: Unable to correct problems, you have held broken packages.
What liblttng-ust0 version is installed on your system?
I do not know what that is or how to find out. This is a clean install of Ubuntu 18.04.1 installed today. If you can tell me commands to run to get more info, I will be happy to provide the info.
PowerShell Core doesn't depend on the package - it is .Net Core dependence. Please start here https://github.com/dotnet/cli/issues/9876 and here https://github.com/dotnet/core-setup/issues/4417
Right. Okay. I do not quite understand what that means - are you saying it by design that the instructions are broken?
As far as I can tell, the instructions in the PowerShell docs, linked from this project's readme, do not work. I would expect these instructions to be corrected (or the readme to be adjusted, if some other instructions should be followed). As a user trying to use this product, I certainly am not going to go hunting workarounds and fixing dependencies - I will just say "Oh I guess back to bash scripts I go".
@sandersaares PowerShell Core is based on .Net Core. The Issue you reported is related to .Net Core. Any application based on .Net Core will be affected by this problem. So this should be resolved in Core Setup repository. I think this is a rather unpleasant problem.
/cc @SteveL-MSFT For information.
@sandersaares ,
I got 18.04.1 for few months now and the PowerShell Core installation from my previous version has been successful.
If this is a fresh installation, I understand the PowerShell was already included in the Ubuntu build 18.04.1. Did you check first that PowerShell Core wasn't already installed??
Check this article: https://blog.ubuntu.com/2018/07/20/powershell-launches-as-a-snap?_ga=2.56632170.1368421086.1531764112-1589195767.1529653827
Maybe trying to install it cause the issue. Keep in mind, if it was already installed, the automatic update will work against the previous version.
:)
@sandersaares I think @iSazonov is pointing out that this appears to be an issue with .NET Core and once they can get a fix, our install instructions should just work (unless they make a change in their install instructions that require us to make a change in ours). We need to wait for them right now. Alternative as @MaximoTrinidad pointed out is to use our snap package which self-contains all dependencies.
one more issue.
Depends: libc6, libgcc1, libgssapi-krb5-2, liblttng-ust0, libstdc++6, zlib1g, libssl1.0.0, libicu55
Ubuntu 18.04 actually has libicu60
@kartas39 All these dependencies is for .Net Core. You should report this in dotnet/core-setup.
@iSazonov whilst your statement is 100% accurate, as PowerShell depends on .Net Core I think the instructions for the install need to include the workaround (or dependency if seen that way).
The fix here is to enable the universe
repositories with:
sudo add-apt-repository universe
This needs to come before the apt install
call.
/cc @SteveL-MSFT @TravisEz13 Should we move this in Docs repo?
Since PowerShell-Docs is in a separate org now (MicrosoftDocs), the GitHub feature to move issues to another repo doesn't work here. I manually created https://github.com/MicrosoftDocs/PowerShell-Docs/issues/4063
Well this is ridiculous. The OP is from 6 months ago. How many users have been affected in that six months which would have greatly benefited from a simple note on the instructions page that says, 'these instructions don't work right now' or 'this is the proper way to do this'?
What kind of bureaucratic mess is powershell in when a simple request to update a page with bad information takes longer than 6 months? The OP was answered with "It's not our fault!" but that's BS because inaccurate documentation is our fault regardless of the underlying cause of the problem. As another user affected by the bad instructions I have wasted a half hour researching why the official instructions don't work and what to do about it and what are the security implications of doing things that are not listed in the official instructions. The snap install on my system throws scary warnings about it dong bad security stuff. I'm off to research--oh wait. work is calling. Guess I'll give up on powershell for now. Maybe next month.
Again, ridiculous and a waste of everyone's time.
I PR was made to update the docs based on my understanding of the issue here: https://github.com/MicrosoftDocs/PowerShell-Docs/pull/4131
I still see this error with the new instructions, see error; https://github.com/MicrosoftDocs/PowerShell-Docs/issues/4063#issuecomment-529118796
I need to reproduce this on another clean Ubuntu WSL just to make sure it is not my client.
This looks like it is still an issue on an up-to-date 18.04.4 system:
# Download the Microsoft repository GPG keys
$ wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
..
# Register the Microsoft repository GPG keys
$ sudo dpkg -i packages-microsoft-prod.deb
..
$ Update the list of products
# sudo apt-get update
..
โฏ sudo apt install powershell
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
powershell : Depends: libicu55 but it is not installable
E: Unable to correct problems, you have held broken packages.
โฏ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
@Daviey Did you try workarounds from above mentioned docs?
@Daviey Did you try workarounds from above mentioned docs?
Actually, my mistake - I used the 16.04 instructions on 18.04. Ignore me.
Most helpful comment
Well this is ridiculous. The OP is from 6 months ago. How many users have been affected in that six months which would have greatly benefited from a simple note on the instructions page that says, 'these instructions don't work right now' or 'this is the proper way to do this'?
What kind of bureaucratic mess is powershell in when a simple request to update a page with bad information takes longer than 6 months? The OP was answered with "It's not our fault!" but that's BS because inaccurate documentation is our fault regardless of the underlying cause of the problem. As another user affected by the bad instructions I have wasted a half hour researching why the official instructions don't work and what to do about it and what are the security implications of doing things that are not listed in the official instructions. The snap install on my system throws scary warnings about it dong bad security stuff. I'm off to research--oh wait. work is calling. Guess I'll give up on powershell for now. Maybe next month.
Again, ridiculous and a waste of everyone's time.