0

I am trying to host my ASP.NET-Core WebApi on nginx on my ubuntu system version 16.04.

According to this and this documentation, I should enter the commands:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg 

However, the command curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg gives me the following error message:

(23) Failed writing body

enter image description here

Am I doing something wrong, or is the documentation wrong?

Update: enter image description here

Thank you

Update:

I can execute the following commands:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg 
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg 
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update

But when I enter sudo apt-get install dotnet-SDK-2.0.0, I am getting the following errors:

enter image description here

Update:

enter image description here

16
  • 2
    You are trying to do this in /etc/apt/sources.list.d, of course you don't have a write permission here as a regular user.
    – Michael
    Oct 14, 2017 at 20:39
  • 2
    Why adding sudo? Just go to your home directory. Btw, you had to add sudo after | if you wanted to do it in such place.
    – Michael
    Oct 14, 2017 at 20:41
  • 2
    So you either are not in your home directory, or have a file microsoft.gpg having root privileges so it can't be overwritten, or don't have write permission in your directory. This command is working for me.
    – Michael
    Oct 14, 2017 at 20:47
  • 2
    Have you executed all commands from this manual?
    – Michael
    Oct 14, 2017 at 21:02
  • 2
    Damn. Try to install some package. For example, pdftk. If it will be installed, I don't know anymore.
    – Michael
    Oct 14, 2017 at 21:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.