mirror of
https://github.com/quamotion/dotnet-packaging.git
synced 2026-02-16 05:44:46 +00:00
How to build deb package without dotnet-runtime-3.1 dependency? #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vbenedichuk on GitHub (Sep 4, 2020).
I have to create a package which will be installed on the manually configured device.
It will already have a .net runtime downloaded and installed manually.
I've created a package, placed to the device but it requires dotnet-runtime-3.1 as a dependency.
How to disable this dependency?
@ichan-akira commented on GitHub (Sep 10, 2020):
Yes I'm looking for this feature as well.
Fyi, for not so pretty workaround if you really need to install the *.deb package but ignoring the dependency problem, you can force it using:
sudo dpkg -i ./YourOutputPackage.1.0.0.debinstead of:
sudo apt install ./YourOutputPackage.1.0.0.debwhich reject the installation because of dependency is not met.
@ichan-akira commented on GitHub (Sep 10, 2020):
After doing some test and with the clue from the README.md, and some reference from Force ‘dotnet publish’ to publish dependencies using PublishWithAspNetCoreTargetManifest and official Microsoft documentation.
you might be interested to use this command:
I check the dependency:
But I think you might want to change the
/p:TargetFramework=netcoreapp2.2into/p:TargetFramework=netcoreapp3.1although I have not test that.@vbenedichuk commented on GitHub (Sep 10, 2020):
Thank you. I've solved this by using separate deb-pkg in my build pipeline.
@ichan-akira commented on GitHub (Sep 10, 2020):
Hi @vbenedichuk if you have extra time, would you mind to elaborate more of your solution?
I'm kinda interested with it.
@qmfrederik commented on GitHub (Sep 10, 2020):
@ichan-akira
Can you let me know how you installed the .NET runtime on the device?
You can override the default dependencies by setting the
DebDotNetDependenciesvariable in your.csprojfile, e.g.:The default dependencies are listed here:
https://github.com/qmfrederik/dotnet-packaging/blob/master/Packaging.Targets/build/Packaging.Targets.targets#L119-L162
@ichan-akira commented on GitHub (Sep 10, 2020):
This is the things that I never knew before! Thanks @qmfrederik this surely will help me out.
I'm currently using dotnet-packaging to create Debian installation package for Raspberry Pi and Ubuntu.
Your tool really help me alot!
@qmfrederik commented on GitHub (Sep 10, 2020):
Thanks, @ichan-akira .
So the dependency on
dotnet-runtime-3.1is problematic for you because there is no package repository for .NET 3.1 for ARM/ARM64 (like Raspberry Pi), right?How did you install the .NET runtime on your Raspberry Pi?
Do you think we should modify the defaults in dotnet-packaging for ARM32/64? If so, how?
@ichan-akira commented on GitHub (Sep 10, 2020):
Btw, the original poster of this issue is @vbenedichuk, I'm just trying to help him since it happen my problem kinda similar to his. 😄
Since I currently require ASP .NET Core 2.2, it is not a problem for me. Proper .NET Core package is provided by Microsoft at https://dotnet.microsoft.com/download/dotnet-core/2.2.
I install it using
*.tar.gzpackage provided by Microsoft. As for now--as far as I know--Microsoft does not provide ARM32 version of*.debpackage for ASP .NET Core 2.2. Which means I cannot install it usingapt-get installnordpkg -i.I already have workaround for it by including the ASP .NET Core 2.2 in the
*.debinstallation package.Unfortunately since I'm not on my work laptop I will elaborate more about how I do it tomorrow.
@ichan-akira commented on GitHub (Sep 11, 2020):
@qmfrederik before knowing following configuration could be made:
I can successfully build
*.debpackage that I want using following command:which the output will produce
*.debpackage not depend to aspnetcore package installed in the system.I am not really sure, but I think since Microsoft is not releasing ASP .NET Core 2.2 in form of Debian installer package for ARM32, user should be able to control (add/remove) the default dependency to output Debian installer package which the method is already provided from you at post https://github.com/qmfrederik/dotnet-packaging/issues/169#issuecomment-690311073.
As for now I will try to dig deep into your mentioned method to find is it suitable for my use case or not.
This project really need more in depth documentation as mentioned in https://github.com/qmfrederik/dotnet-packaging/issues/103. Since currently I am using Debian package I am planning to add more documentation especially for Debian package either in form of README.md or Wiki if you allow me 😃
@vbenedichuk commented on GitHub (Sep 24, 2020):
https://edi.wang/post/2019/9/29/setup-net-core-30-runtime-and-sdk-on-raspberry-pi-4
The issue is that I don't need any dependencies for the package. But looks like it is not feasible.
Anyway I've solved it.
@vbenedichuk commented on GitHub (Sep 24, 2020):
I've done it manually.
I've built a package using dotnet-packaging, extracted its contents using
dpkg -x ...deb /tmp/myfolder.Removed dependency and packed it back using
dpkg-deb -b ...After that, I've just updated pipeline to generate required folders/files structure, using initial package as a template, copy built code into it, and build it using
dpkg-deb -b@ichan-akira commented on GitHub (Sep 24, 2020):
Ah I see, thanks for info @vbenedichuk definitely a workaround to solve it
@atauenis commented on GitHub (Dec 12, 2020):
Such package can be built via two ways.
The first is to manually kill the dependency, but this is a dirty hack.
And the second is to make a self-contained app. Seems that dotnet-deb can detect this and replaces
dotnet-runtime-3.1with few prerequisites which need to run self-contained apps. It will work on any system, even where there are no .NET Core at all.