Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install .NET Core 2.0 on Amazon Linux AMI #930

Closed
goforgold opened this issue Sep 2, 2017 · 37 comments
Closed

Cannot install .NET Core 2.0 on Amazon Linux AMI #930

goforgold opened this issue Sep 2, 2017 · 37 comments

Comments

@goforgold
Copy link

I am trying to update from .NET Core 2.0 Preview 2 Final to 2.0 Final Release on the Amazon EC2 instance due to some dependency issue.

When I run install command sudo yum install dotnet-sdk-2.0.0 it produces following error.

Error: Package: dotnet-runtime-2.0.0-2.0.0-1.x86_64 (packages-microsoft-com-prod)
           Requires: openssl-libs

And, when I try to install openssl-libs using package manager with command yum install openssl-libs, it says No package openssl-libs available.

I've checked package repository and didn't found any package with name openssl-libs there. However, openssl is installed already in the machine, I confirmed that by running openssl version command. The version is 1.0.1k-fips 8 Jan 2015.

Please suggest how to resolve this dependency.

@heathhey
Copy link

heathhey commented Sep 4, 2017

You might have better luck following the instructions here:

https://github.com/dotnet/core/blob/0b1a1631593d6d379fbdfe2b23597a5c25ea4fc9/Documentation/build-and-install-rhel6-prerequisites.md

Amazon Linux already has a later version of curl, so you might need libcurl-devel installed as well.

@goforgold
Copy link
Author

I managed to install .NET Core 2.0 using the source code as instructed here.

I didn't find any complexity in that way. It hardly took 10 minutes to get everything setup.

@hchungi
Copy link

hchungi commented Sep 11, 2017

I was almost desperate.
I tries many ways, none of them can work for me.

Afterwards, I download the .NET Core 2.0 runtime directly with following link:

https://download.microsoft.com/download/5/F/0/5F0362BD-7D0A-4A9D-9BF9-022C6B15B04D/dotnet-runtime-2.0.0-linux-x64.tar.gz

And, use the old fashion way like installing .net core 1.1 with commands:

sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet-runtime-2.0.0-linux-x64.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin

It worked. Very simple like you used to do.

@zl4bv
Copy link

zl4bv commented Sep 28, 2017

Does not work with Amazon Linux when following these instructions.

[ec2-user@ip-xx-xx-xx-xx ~]$ sudo yum install dotnet-sdk-2.0.0
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package dotnet-sdk-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: dotnet-runtime-2.0.0 >= 2.0.0 for package: dotnet-sdk-2.0.0-2.0.0-1.x86_64
--> Processing Dependency: aspnetcore-store-2.0.0 >= 2.0.0 for package: dotnet-sdk-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package aspnetcore-store-2.0.0.x86_64 0:2.0.0-1 will be installed
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Processing Dependency: dotnet-hostfxr-2.0.0 for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package dotnet-hostfxr-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: dotnet-host >= 2.0.0 for package: dotnet-hostfxr-2.0.0-2.0.0-1.x86_64
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package dotnet-host.x86_64 0:2.0.0-1 will be installed
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: dotnet-runtime-2.0.0-2.0.0-1.x86_64 (packages-microsoft-com-prod)
           Requires: openssl-libs
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

@wfurt
Copy link
Member

wfurt commented Sep 28, 2017

If you already have openssl you can try to run yum with --skip-broken (as the message suggests)
All what dotnet needs is to find dynamic libraries from openssl. (and libcurl)

@wfurt
Copy link
Member

wfurt commented Sep 28, 2017

BTW AMI Linux is NOT one of the supported and test platforms. There should be no surprise that there are some bumps. This is one reason for publishing the tar file so you do not need to fight package dependencies.

@h3smith
Copy link

h3smith commented Sep 28, 2017

If you want to use AWS, drop it in Docker and use ECS.

@Paschoali
Copy link

Like hchungi said, I just did:

Download .NET Core 2.0.0 runtime libraries (always check if URL is right, maybe it can be changed):
wget https://download.microsoft.com/download/5/F/0/5F0362BD-7D0A-4A9D-9BF9-022C6B15B04D/dotnet-runtime-2.0.0-linux-x64.tar.gz

Create folder to .NET Core and extract your tar.gz:

mkdir -p $HOME/dotnet && tar zxf dotnet-runtime-2.0.0-linux-x64.tar.gz -C $HOME/dotnet

Finally, export dotnet to globally variable:
export PATH=$PATH:$HOME/dotnet

Just it :)

@goforgold
Copy link
Author

goforgold commented Oct 6, 2017 via email

@Petermarcu
Copy link
Member

Sounds like people have found a good solution. I'm going to close this out now.

@goforgold
Copy link
Author

goforgold commented Oct 6, 2017 via email

@omajid
Copy link
Member

omajid commented Oct 6, 2017

Any chance you could try a distribution other than Amazon Linux? The .NET Core project publishes packages for several distributions (such as CentOS, Debian, Ubuntu) and several other distributions are now starting to carry .NET Core too (such as Arch, CentOS, Fedora, RHEL). I dont know if we have a way to contribute packages to Amazon Linux directly.

@Petermarcu
Copy link
Member

Yes, I've been told the Centos one works: https://www.microsoft.com/net/core#linuxcentos

@Petermarcu
Copy link
Member

I would assume that someone needs to work with AWS to get .NET Core into their package feed.

@goforgold
Copy link
Author

goforgold commented Oct 6, 2017 via email

@robyle
Copy link

robyle commented Oct 11, 2017

I use the Aliyun ECS,The OS version is Centos 6.8. I also met this problem.The Information like this:
[root@iZwz9bh8rvZ ~]# sudo yum install dotnet-sdk-2.0.0
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package dotnet-sdk-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: dotnet-runtime-2.0.0 >= 2.0.0 for package: dotnet-sdk-2.0.0-2.0.0-1.x86_64
--> Processing Dependency: aspnetcore-store-2.0.0 >= 2.0.0 for package: dotnet-sdk-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package aspnetcore-store-2.0.0.x86_64 0:2.0.0-1 will be installed
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Processing Dependency: dotnet-hostfxr-2.0.0 for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package dotnet-hostfxr-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: dotnet-host >= 2.0.0 for package: dotnet-hostfxr-2.0.0-2.0.0-1.x86_64
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Running transaction check
---> Package dotnet-host.x86_64 0:2.0.0-1 will be installed
---> Package dotnet-runtime-2.0.0.x86_64 0:2.0.0-1 will be installed
--> Processing Dependency: openssl-libs for package: dotnet-runtime-2.0.0-2.0.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: dotnet-runtime-2.0.0-2.0.0-1.x86_64 (packages-microsoft-com-prod)
Requires: openssl-libs
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

@Paschoali
Copy link

Aliyun ECS? Whatever, did you read the comments? We suggested some solutions. Sure that of them will help you.

@heathhey
Copy link

Is there a SRPM for the dotnet-runtime package? Or is there a spec file in the repo somewhere? I couldn't find one.

@omajid
Copy link
Member

omajid commented Oct 11, 2017

Is there a SRPM for the dotnet-runtime package? Or is there a spec file in the repo somewhere?

We use fpm to produce RPMs (and debs) instead of using rpmbuild. There are no SPRMs or spec files because of that.

The configuration for -runtime and -host RPMs is available here: https://github.com/dotnet/core-setup/tree/master/src/pkg/packaging/rpm

Here is the source that reads that config files above to build command line for fpm: https://github.com/dotnet/core-setup/blob/master/tools-local/tasks/BuildFPMToolPreReqs.cs

@ozyman42
Copy link

ozyman42 commented Nov 30, 2017

The old links may not work so go here https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md and use the SDK binary link for the latest tar.gz file.

@gtechx
Copy link

gtechx commented Apr 8, 2018

I am a client programmer.
I do not like to install any dependency myself on linux.
some problems are too difficulty to solve.
see golang.

@ddobric
Copy link

ddobric commented May 23, 2018

Unfortunately I didn't make this working. Using hortonworks sandbox withCentOS.
Error as already mentioned above:

Error: Package: dotnet-runtime-2.0.6-2.0.6-1.x86_64 (packages-microsoft-com-prod )
Requires: openssl-libs
Error: Package: dotnet-runtime-deps-2.1.0-rc1-2.1.0_rc1-1.x86_64 (packages-micro soft-com-prod)

@jchannon
Copy link
Contributor

Installing Net Core 2.1 on Amazon Linux still seems to be an issue :(

@wfurt
Copy link
Member

wfurt commented Jul 11, 2018

What base OS do you use and what .Net package? Did you check that everything works using tar distro? I'm trying to figure out if this is pure packaging issue or if there are really missing dependencies.

@jchannon
Copy link
Contributor

I did sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm and yum update and yum install dotnet-sdk-2.1

Output is below:

amazon-linux-ami: Resolving Dependencies
    amazon-linux-ami: --> Running transaction check
    amazon-linux-ami: ---> Package dotnet-sdk-2.1.x86_64 0:2.1.301-1 will be installed
    amazon-linux-ami: --> Processing Dependency: dotnet-runtime-2.1 >= 2.1.1 for package: dotnet-sdk-2.1-2.1.301-1.x86_64
    amazon-linux-ami: --> Processing Dependency: aspnetcore-runtime-2.1 >= 2.1.1 for package: dotnet-sdk-2.1-2.1.301-1.x86_64
    amazon-linux-ami: --> Running transaction check
    amazon-linux-ami: ---> Package aspnetcore-runtime-2.1.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: ---> Package dotnet-runtime-2.1.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: --> Processing Dependency: dotnet-hostfxr-2.1 >= 2.1.2 for package: dotnet-runtime-2.1-2.1.2-1.x86_64
    amazon-linux-ami: --> Processing Dependency: dotnet-runtime-deps-2.1 >= 2.1.2 for package: dotnet-runtime-2.1-2.1.2-1.x86_64
    amazon-linux-ami: --> Running transaction check
    amazon-linux-ami: ---> Package dotnet-hostfxr-2.1.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: --> Processing Dependency: dotnet-host >= 2.1.2 for package: dotnet-hostfxr-2.1-2.1.2-1.x86_64
    amazon-linux-ami: ---> Package dotnet-runtime-2.1.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: --> Processing Dependency: dotnet-runtime-deps-2.1 >= 2.1.2 for package: dotnet-runtime-2.1-2.1.2-1.x86_64
    amazon-linux-ami: --> Running transaction check
    amazon-linux-ami: ---> Package dotnet-host.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: ---> Package dotnet-runtime-2.1.x86_64 0:2.1.2-1 will be installed
    amazon-linux-ami: --> Processing Dependency: dotnet-runtime-deps-2.1 >= 2.1.2 for package: dotnet-runtime-2.1-2.1.2-1.x86_64
    amazon-linux-ami: --> Finished Dependency Resolution
    amazon-linux-ami:  You could try using --skip-broken to work around the problem
    amazon-linux-ami: Error: Package: dotnet-runtime-2.1-2.1.2-1.x86_64 (packages-microsoft-com-prod)
    amazon-linux-ami:            Requires: dotnet-runtime-deps-2.1 >= 2.1.2
    amazon-linux-ami:            Available: dotnet-runtime-deps-2.1-2.1.0-1.x86_64 (packages-microsoft-com-prod)
    amazon-linux-ami:                dotnet-runtime-deps-2.1 = 2.1.0-1
    amazon-linux-ami:            Available: dotnet-runtime-deps-2.1-2.1.1-1.x86_64 (packages-microsoft-com-prod)
    amazon-linux-ami:                dotnet-runtime-deps-2.1 = 2.1.1-1
    amazon-linux-ami:  You could try running: rpm -Va --nofiles --nodigest

@wfurt
Copy link
Member

wfurt commented Jul 11, 2018

cc: @tmds. seems like it cannot find dotnet-runtime-deps-2.1 -2.1.2

@tmds
Copy link
Member

tmds commented Jul 11, 2018

@wfurt, @jchannon is installing from Microsoft feed. Are those packages missing?

@jchannon
Copy link
Contributor

jchannon commented Jul 11, 2018

@leecow
Copy link
Member

leecow commented Jul 11, 2018

Looks like the updated runtime-deps and sdk didn't make the upload. Checking into this now.

@leecow
Copy link
Member

leecow commented Jul 11, 2018

Alrighty, sorry about that. Give it another whirl now.

@jchannon
Copy link
Contributor

jchannon commented Jul 11, 2018 via email

@wfurt
Copy link
Member

wfurt commented Jul 11, 2018

That goes back to original issue. AMI Linux names packages different than RedHat. Now, assuming you have correct openssl 1.0.x installed you can try following trick:

openssl-libs-ami.spec.txt

Download attached spec file.

rpmbuild --bb openssl-libs-ami.spec.txt
That should produce empty openssl-libs in /root/rpmbuild/RPMS/
(use find if not there as the location may wary)
rpm -i openssl-libs-1.0.0-0.x86_64.rpm

and try the install again.
Good luck. AMI linux is not tested so .net may or may not work properly.
The instructions should help you to at least try.

@sjwoodard
Copy link

The @wfurt solution worked for me, just run sudo yum install rpm-build to get started.

@juancrl
Copy link

juancrl commented Dec 10, 2018

Perfect also in my case. The folder was different, as stated :

sudo yum install rpm-build
wget https://github.com/dotnet/core/files/2186067/openssl-libs-ami.spec.txt
rpmbuild --bb openssl-libs-ami.spec.txt
sudo rpm -i /root/rpmbuild/RPMS/x86_64/openssl-libs-1.0.0-0.x86_64.rpm
sudo yum install -y powershell

@ptdel
Copy link

ptdel commented Mar 6, 2019

Provides: openssl-libs = 1.0.0-0 openssl-libs(x86-64) = 1.0.0-0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /usr/src/rpm/BUILDROOT/openssl-libs-1.0.0-0.x86_64
Wrote: /usr/src/rpm/RPMS/x86_64/openssl-libs-1.0.0-0.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.13DnAm

for whatever reason this chose today to start hanging forever during deployments. I don't see an actual %clean step in the rpm spec.

@darshit95
Copy link

Folks who are trying to install azure powershell and have ended up here can use @juancrl mentioned solution, it surely works !
sudo yum install rpm-build
wget https://github.com/dotnet/core/files/2186067/openssl-libs-ami.spec.txt
rpmbuild --bb openssl-libs-ami.spec.txt
sudo rpm -i /root/rpmbuild/RPMS/x86_64/openssl-libs-1.0.0-0.x86_64.rpm
sudo yum install -y powershell

@vvaezian
Copy link

vvaezian commented Oct 8, 2020

For me the path of created openssl-libs was different. So I had to find it first (as suggested by wfurt)

wget https://github.com/dotnet/core/files/2186067/openssl-libs-ami.spec.txt
rpmbuild --bb openssl-libs-ami.spec.txt
sudo find / -iname RPMS  # output: /usr/src/rpm/RPMS
sudo rpm -i /usr/src/rpm/RPMS/x86_64/openssl-libs-1.0.0-0.x86_64.rpm
sudo yum install -y powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests