我正試圖在Amazon Linux映像上安裝Nuget。我的目標是使用支持.netcore的AWS .NET SDK進行一些研究。如何在亞馬遜Linux上安裝Nuget
我已經嘗試過三次(在新鮮實例上每次嘗試)主要安裝方法。
1 - 安裝.netcore,然後從源代碼編譯Nuget。
我安裝.netcore成功的方向here雖然我修改(我的變化以粗體顯示)如何路徑的更新是通過使用以下步驟堅持以下幾點:
# sudo yum install libunwind libicu -y
# curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=835019
# sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
**# echo 'pathmunge /opt/dotnet' > /etc/profile.d/dotnetcore.sh**
**# chmod +x /etc/profile.d/dotnetcore.sh**
**# . /etc/profile**
我再從克隆的NuGet碼這裏是https://github.com/NuGet/NuGet.Client並且運行了build.sh,它成功完成但沒有用Nuget可執行文件創建工件子目錄。這個方法只是用來安裝NuGet CLI - 不是軟件包管理器 - 但是既不安裝。根據此網站,Linux僅支持CLI:https://docs.nuget.org/ndocs/guides/install-nuget(「NuGet CLI是可在Windows,Mac OS X和Linux上運行並支持所有NuGet功能的命令行實用程序。」)
2 - 安裝單並運行「百勝安裝的NuGet」
我通過執行這些步驟已成功安裝了單聲道:
# sudo yum -y install cmake bison gettext glib2 freetype fontconfig libpng
libpng-devel libX11 libX11-devel glib2-devel libexif glibc-devel
urw-fonts java
unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
# cd /usr/local/src
# sudo wget http://download.mono-project.com/sources/mono/mono-4.8.0.382.tar.bz2
# sudo tar jxf mono-4.8.0.382.tar.bz2
# cd mono-4.8.0
# sudo ./configure --prefix=/opt/mono
# sudo make
# sudo make install
單是安裝和測試我加了一些回購使用以下命令後:
# rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
# yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
# yum-config-manager --add-repo http://download.mono-project.com/repo/centos-nightly/
我收到了依賴錯誤,當我跑百勝安裝的NuGet命令,結果:
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest
amzn-updates/latest
Resolving Dependencies
--> Running transaction check
---> Package nuget.noarch 0:2.12+mono-0.xamarin.1 will be installed
--> Processing Dependency: mono(Microsoft.Build.Engine) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.ServiceModel) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(Microsoft.Build.Framework) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Xml.Linq) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Runtime.Serialization) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(WindowsBase) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(Microsoft.CSharp) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.ComponentModel.DataAnnotations) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(Microsoft.Build) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Security) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.ComponentModel.Composition) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(mscorlib) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Core) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Xml) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Processing Dependency: mono(System.Data.Services.Client) = 4.0.0.0 for package: nuget-2.12+mono-0.xamarin.1.noarch
--> Running transaction check
---> Package mono-core.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Processing Dependency: mono(System.ServiceProcess) = 4.0.0.0 for package: mono-core-4.9.0.1028-0.nightly.1.x86_64
--> Processing Dependency: libgdiplus0 for package: mono-core-4.9.0.1028-0.nightly.1.x86_64
---> Package mono-data.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-devel.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Processing Dependency: mono-data-oracle = 4.9.0.1028 for package: mono-devel-4.9.0.1028-0.nightly.1.x86_64
--> Processing Dependency: mono-winforms = 4.9.0.1028 for package: mono-devel-4.9.0.1028-0.nightly.1.x86_64
--> Processing Dependency: libgdiplus-devel for package: mono-devel-4.9.0.1028-0.nightly.1.x86_64
--> Processing Dependency: libmonosgen-2.0.so.1()(64bit) for package: mono-devel-4.9.0.1028-0.nightly.1.x86_64
---> Package mono-wcf.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Processing Dependency: mono(System.Web.Extensions) = 4.0.0.0 for package: mono-wcf-4.9.0.1028-0.nightly.1.x86_64
---> Package mono-web.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Processing Dependency: mono(Mono.Data.Sqlite) = 4.0.0.0 for package: mono-web-4.9.0.1028-0.nightly.1.x86_64
---> Package mono-winfxcore.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Running transaction check
---> Package libgdiplus-devel.x86_64 0:3.12-1 will be installed
---> Package libgdiplus0.x86_64 0:3.12-1 will be installed
--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libtiff.so.5(LIBTIFF_4.0)(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libtiff.so.5()(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libcairo.so.2()(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libpng15.so.15()(64bit) for package: libgdiplus0-3.12-1.x86_64
---> Package libmonosgen-2_0-1.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-data-oracle.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-data-sqlite.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-extras.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-mvc.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
---> Package mono-winforms.x86_64 0:4.9.0.1028-0.nightly.1 will be installed
--> Running transaction check
---> Package cairo.x86_64 0:1.12.14-6.8.amzn1 will be installed
--> Processing Dependency: libpixman-1.so.0()(64bit) for package: cairo-1.12.14-6.8.amzn1.x86_64
---> Package libgdiplus0.x86_64 0:3.12-1 will be installed
--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libpng15.so.15()(64bit) for package: libgdiplus0-3.12-1.x86_64
---> Package libtiff.x86_64 0:4.0.3-25.27.amzn1 will be installed
--> Processing Dependency: libjbig.so.2.0()(64bit) for package: libtiff-4.0.3-25.27.amzn1.x86_64
--> Running transaction check
---> Package jbigkit-libs.x86_64 0:2.0-11.4.amzn1 will be installed
---> Package libgdiplus0.x86_64 0:3.12-1 will be installed
--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: libgdiplus0-3.12-1.x86_64
--> Processing Dependency: libpng15.so.15()(64bit) for package: libgdiplus0-3.12-1.x86_64
---> Package pixman.x86_64 0:0.32.4-4.11.amzn1 will be installed
--> Finished Dependency Resolution
**Error: Package: libgdiplus0-3.12-1.x86_64 (download.mono-project.com_repo_centos_)**
**Requires: libpng15.so.15()(64bit)**
**Error: Package: libgdiplus0-3.12-1.x86_64 (download.mono-project.com_repo_centos_)**
**Requires: libpng15.so.15(PNG15_0)(64bit)**
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我試圖用--skip-破命令重新安裝,但的NuGet沒有安裝。
在這一點上我試圖從這裏http://www.libpng.org/pub/png/libpng.html
建設最新版的libpng代碼在這一點上,我王建宇,山西高等學校達到我的linux能力的極限手動更新的libpng軟件包。我能夠全成建的libpng與
./configure
make
make install
但我不能肯定,其中更新或者,如果我只是現在有兩個版本的libpng庫。我不確定如何查看Yum使用哪個版本。
3 - 安裝.NET的核心,然後運行「百勝安裝的NuGet」
,我感到我在嘗試#2收到完全相同的錯誤。
如果您使用.NET Core,那麼'dotnet restore'是包裝NuGet恢復操作的方式。如果你使用Mono,停止從源代碼構建,因爲你不知道它是如何工作的。 Mono項目主頁清楚地顯示瞭如何從Xamarin回購安裝二進制文件,但是您需要在這個階段找到一臺乾淨的機器來開始。 –