I've followed these instructions both for Ubuntu 18.04 and 19.10. In both cases, dotnet --info doesn't work at the end of the process ('command dotnet not found'). This is true whether you run it in the same shell, a new shell, or having logged out and back in again.
I used the installation commands from the 'Register Microsoft key and feed' section, then the 'Install the .NET Core SDK' section.
The installation doesn't appear to have added anything to the path. The location where the dotnet executable is located isn't documented on this page, and doesn't seem particularly easy to determine with an online search - hence it is not trivial to add it manually to the path.
Here's a video of the installation steps I followed and the failure: https://www.dropbox.com/s/8gl8hpzttgtzuc2/InstallNotWorking.mp4?dl=0
As an additional point - it would be good if the copied commands were automatically followed by an ENTER. The user currently has to hit ENTER after pasting.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@misterspeedy Hi! I actually just ran into this too on Windows using the Ubuntu Windows Subsystem for Linux. Your video (thank you for making that!) confirms the same problem I ran into. For some reason the paste into your terminal isn't working correctly. When you copied the following:
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
And pasted it, the terminal stopped processing commands once sudo apt-get install apt-transport-https completed. So you still need to run the last two commands:
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
Oh, now that IS interesting, thanks. I'll try and work out why/how the build-in copy/paste isn't working and report back here tomorrow.
One thing I will say though - it is highly reproducible as I went through these steps about four times times today.
Yeah same thing happened to me too which is very strange. I didn't try on a different distro though.
@misterspeedy Oddly enough though, too, I was working on adding file paths that get you should look for to validate it was installed: https://github.com/dotnet/docs/pull/17870/files
Can confirm that copying the commands from the 'Install the .NET Core SDK' two lines at a time does work correctly. As the issue is very reproducible (and the page does effectively encourage the user to copy all four lines with the 'Copy' button) I would still suggest some change to the page. Maybe just break that section (and similar ones) into two?
@dagood Just asking you about this as you seem well versed in Linux. Why does copy/pasting fail on these? Is there something with the sudo apt-get install apt-transport-https command that resets the terminal paste buffer or something?
When apt-get install actually has to do something (package not installed already, plus other subtleties), it prompts the user for Y/n. The prompt causes the rest of your current input to get dropped. (I'm not familiar with exactly how--if it's swallowing the rest of the command, or prompting clears it or something.) The apt-get install starts going as soon as the newline from the paste happens, so the rest is cleared. Using ; instead of newlines would let the paste complete before running any commands--then only after the paste is complete, they'd all run. (Using && would make it stop if one fails, otherwise they'll all run no matter what.)
You can play around with this by looking at the difference between pasting this:
echo start; read; echo end
and pasting this (what we have):
echo start
read
echo end
All that said... we should probably just add -y to the install command to avoid prompting.
Took a look at the video. It looks like in this case there isn't an actual prompt, but it does install the package and drop input. Haven't seen that before. 😄 Maybe the prompt "auto-accepts" internally but still drops input? At this point I question if I just have this all wrong at some basic level, though.
And... -y doesn't actually fix this. In an ubuntu:18.04 Docker container, pasting this installs sudo but doesn't print my message:
apt-get update
apt-get install -y sudo
echo Hello there
Ok, so: how do we fix this. I recommend this:
sudo apt-get update && \
sudo apt-get install apt-transport-https && \
sudo apt-get update && \
sudo apt-get install dotnet-sdk-3.1
Sorry, actually this, because the update will sometimes fail if apt-transport-https isn't installed yet so we should ignore that exit code:
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-3.1
(And might as well throw in -y to make it easier.)
/cc @leecow @NikolaMilosavljevic
I found the root cause from here: https://serverfault.com/a/634215, intentional behavior:
It's to avoid someone typing their next command while packages are downloading, but then that input being used as the answer to a prompt during installation.
Thanks @dagood and @Thraka for your diligence in looking into this thus far!
@dagood I'll update the instructions with this (in the redesign pr).
Most helpful comment
@dagood I'll update the instructions with this (in the redesign pr).