Linux Ubuntu 16.04 安装 .Net Core
1、切换 root 权限
sudo passwd root,输入新的密码后输入 su root 即可切换
![](https://images2015.cnblogs.com/blog/960358/201704/960358-20170405150854894-1533072825.png)
2、安装.net core
首先要根据ubuntu的版本来区分需要下载的.net core版本
查看版本的命令: cat /etc/issue
Ubutu 14.4 执行:
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
Ubuntu 16.4执行:
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
![](https://images2015.cnblogs.com/blog/960358/201704/960358-20170405150929128-1196219605.png)
3、安装 .netcore sdk
sudo apt-get install dotnet-dev-1.0.0-preview2-003121
![](https://images2015.cnblogs.com/blog/960358/201704/960358-20170405150943097-467143790.png)
![](https://images2015.cnblogs.com/blog/960358/201704/960358-20170405151000738-1486245510.png)
至此,就安装好了,可以试一下键入:
dotnet new
dotnet restore
dotnet run
就完成了第一个dotnet程序了
![](https://images2015.cnblogs.com/blog/960358/201704/960358-20170405151018175-705813529.png)