Installation under Ubuntu 20.04 fails #78

Open
opened 2026-01-29 16:28:44 +00:00 by claunia · 2 comments
Owner

Originally created by @mathias-ho on GitHub (May 25, 2020).

When installing a debian package under Ubuntu 20.04 an error occurs.

Note: Because the RuntimeIdentifier (RID) ubuntu.20.04-x64 seems to be still missing in .NET Core 3.1.4, I use 18.04 to create the package.

Note2: For the error "Could not load file or assembly NuGet.Frameworks [...]" I already use the fix from https://github.com/qmfrederik/dotnet-packaging/issues/148#issuecomment-612954771

Note 3: Installation of the same package under Ubuntu 18.04 works fine.

Create package:

dotnet restore
dotnet publish -c Release -f netcoreapp3.1 -r ubuntu.18.04-x64
dotnet deb --no-restore -c Release -f netcoreapp3.1 -r ubuntu.18.04-x64

Creates the package as expected. Installation on Ubuntu 20.04 target machine gives:

root@synapse2:/var/cache/apt/archives# apt-get install xxx-setup
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  xxx-setup
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 23.2 MB of archives.
After this operation, 82.2 MB of additional disk space will be used.
Get:1 https://apt.xxx.org/ubuntu-focal-prod focal/main amd64 xxx-setup amd64 5.0.304-ubuntu.18.04-x64 [23.2 MB]
Fetched 23.2 MB in 4s (6,070 kB/s)
(Reading database ... 108003 files and directories currently installed.)
Preparing to unpack .../24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb ...
Unpacking xxx-setup (5.0.303-ubuntu.18.04-x64) ...
dpkg: error processing archive /tmp/apt-dpkg-install-VIXfEH/24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb (--unpack):
 unable to open '/usr/local/bin/xxx-setup.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while processing:
 /tmp/apt-dpkg-install-VIXfEH/24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I searched a lot but didn't find any solution so far. I'm even not sure if this is an issue with dotnet-packaging or somewhere else.

Originally created by @mathias-ho on GitHub (May 25, 2020). When installing a debian package under Ubuntu 20.04 an error occurs. Note: Because the RuntimeIdentifier (RID) ubuntu.20.04-x64 seems to be still missing in .NET Core 3.1.4, I use 18.04 to create the package. Note2: For the error "Could not load file or assembly NuGet.Frameworks [...]" I already use the fix from https://github.com/qmfrederik/dotnet-packaging/issues/148#issuecomment-612954771 Note 3: Installation of the same package under Ubuntu 18.04 works fine. Create package: ``` dotnet restore dotnet publish -c Release -f netcoreapp3.1 -r ubuntu.18.04-x64 dotnet deb --no-restore -c Release -f netcoreapp3.1 -r ubuntu.18.04-x64 ``` Creates the package as expected. Installation on Ubuntu 20.04 target machine gives: ``` root@synapse2:/var/cache/apt/archives# apt-get install xxx-setup Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: xxx-setup 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 23.2 MB of archives. After this operation, 82.2 MB of additional disk space will be used. Get:1 https://apt.xxx.org/ubuntu-focal-prod focal/main amd64 xxx-setup amd64 5.0.304-ubuntu.18.04-x64 [23.2 MB] Fetched 23.2 MB in 4s (6,070 kB/s) (Reading database ... 108003 files and directories currently installed.) Preparing to unpack .../24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb ... Unpacking xxx-setup (5.0.303-ubuntu.18.04-x64) ... dpkg: error processing archive /tmp/apt-dpkg-install-VIXfEH/24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb (--unpack): unable to open '/usr/local/bin/xxx-setup.dpkg-new': No such file or directory No apport report written because the error message indicates an issue on the local system Errors were encountered while processing: /tmp/apt-dpkg-install-VIXfEH/24-xxx-setup_5.0.303-ubuntu.18.04-x64_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) ``` I searched a lot but didn't find any solution so far. I'm even not sure if this is an issue with dotnet-packaging or somewhere else.
Author
Owner

@mikebm94 commented on GitHub (Jun 27, 2020):

I've successfully installed the produced debian package locally under Ubuntu 20.04.
I used .NET Core 3.1.301 and published for the linux-x64 runtime instead of ubuntu.18.04-x64
Is it possible for you to use the linux-x64 runtime instead?

Also, when I tried sudo apt-get install myproject.1.0.0.linux-x64.deb I got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package myproject.1.0.0.linux-x64.deb
E: Couldn't find any package by glob 'myproject.1.0.0.linux-x64.deb'
E: Couldn't find any package by regex 'myproject.1.0.0.linux-x64.deb'

But, when I used sudo apt-get install ./myproject.1.0.0.linux-x64.deb it succeeded, no idea if it's relevant to your situation.

I'm not sure what's happening on your end but this was my process:

Create a basic .NET Core 3.1 console application, and add set the RuntimeIdentifier property to linux-x64 in myproject.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
  </PropertyGroup>

</Project>

Open terminal and cd to project directory and run:

dotnet restore
dotnet publish -c Release -r linux-x64
dotnet deb -c Release -r linux-x64
cd bin/Release/netcoreapp3.1/linux-x64
sudo apt-get install ./myproject.1.0.0.linux-x64.deb

Output:

<user-name>@<host-name>:~$ cd <path-to-project>
<user-name>@<host-name>:~/<path-to-project>$ dotnet restore
  Determining projects to restore...
  Restored /home/<user-name>/<path-to-project>/myproject.csproj (in 282 ms).
<user-name>@<host-name>:~/<path-to-project>$ dotnet publish -c Release -r linux-x64
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/
<user-name>@<host-name>:~/<path-to-project>$ dotnet deb -c Release -r linux-x64
dotnet deb (0.1.171+9941587984)
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/
  Creating DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/'
  Created DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/'
<user-name>@<host-name>:~/<path-to-project>$ cd bin/Release/netcoreapp3.1/linux-x64
<user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ sudo apt-get install ./myproject.1.0.0.linux-x64.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'myproject' instead of './myproject.1.0.0.linux-x64.deb'
The following NEW packages will be installed:
  myproject
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.2 MB of archives.
After this operation, 78.2 MB of additional disk space will be used.
Get:1 /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb myproject amd64 1.0.0 [22.2 MB]
Selecting previously unselected package myproject.
(Reading database ... 169624 files and directories currently installed.)
Preparing to unpack .../myproject.1.0.0.linux-x64.deb ...
Unpacking myproject (1.0.0) ...
Setting up myproject (1.0.0) ...
<user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ which myproject
/usr/local/bin/myproject

myproject is in the PATH and executes fine.

@mikebm94 commented on GitHub (Jun 27, 2020): I've successfully installed the produced debian package locally under Ubuntu 20.04. I used .NET Core 3.1.301 and published for the `linux-x64` runtime instead of `ubuntu.18.04-x64` Is it possible for you to use the `linux-x64` runtime instead? Also, when I tried `sudo apt-get install myproject.1.0.0.linux-x64.deb` I got this error: ``` Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package myproject.1.0.0.linux-x64.deb E: Couldn't find any package by glob 'myproject.1.0.0.linux-x64.deb' E: Couldn't find any package by regex 'myproject.1.0.0.linux-x64.deb' ``` But, when I used `sudo apt-get install ./myproject.1.0.0.linux-x64.deb` it succeeded, no idea if it's relevant to your situation. I'm not sure what's happening on your end but this was my process: Create a basic .NET Core 3.1 console application, and add set the `RuntimeIdentifier` property to `linux-x64` in `myproject.csproj` ``` <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.1</TargetFramework> <RuntimeIdentifier>linux-x64</RuntimeIdentifier> </PropertyGroup> </Project> ``` Open terminal and `cd` to project directory and run: ``` dotnet restore dotnet publish -c Release -r linux-x64 dotnet deb -c Release -r linux-x64 cd bin/Release/netcoreapp3.1/linux-x64 sudo apt-get install ./myproject.1.0.0.linux-x64.deb ``` Output: ``` <user-name>@<host-name>:~$ cd <path-to-project> <user-name>@<host-name>:~/<path-to-project>$ dotnet restore Determining projects to restore... Restored /home/<user-name>/<path-to-project>/myproject.csproj (in 282 ms). <user-name>@<host-name>:~/<path-to-project>$ dotnet publish -c Release -r linux-x64 Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... All projects are up-to-date for restore. myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/ <user-name>@<host-name>:~/<path-to-project>$ dotnet deb -c Release -r linux-x64 dotnet deb (0.1.171+9941587984) Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/ Creating DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/' Created DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/' <user-name>@<host-name>:~/<path-to-project>$ cd bin/Release/netcoreapp3.1/linux-x64 <user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ sudo apt-get install ./myproject.1.0.0.linux-x64.deb Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'myproject' instead of './myproject.1.0.0.linux-x64.deb' The following NEW packages will be installed: myproject 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/22.2 MB of archives. After this operation, 78.2 MB of additional disk space will be used. Get:1 /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb myproject amd64 1.0.0 [22.2 MB] Selecting previously unselected package myproject. (Reading database ... 169624 files and directories currently installed.) Preparing to unpack .../myproject.1.0.0.linux-x64.deb ... Unpacking myproject (1.0.0) ... Setting up myproject (1.0.0) ... <user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ which myproject /usr/local/bin/myproject ``` `myproject` is in the PATH and executes fine.
Author
Owner

@wuzlai commented on GitHub (Jul 18, 2020):

建依赖关系树读取状态信息...收件人:找

I've successfully installed the produced debian package locally under Ubuntu 20.04.
I used .NET Core 3.1.301 and published for the linux-x64 runtime instead of ubuntu.18.04-x64
Is it possible for you to use the linux-x64 runtime instead?

Also, when I tried sudo apt-get install myproject.1.0.0.linux-x64.deb I got this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package myproject.1.0.0.linux-x64.deb
E: Couldn't find any package by glob 'myproject.1.0.0.linux-x64.deb'
E: Couldn't find any package by regex 'myproject.1.0.0.linux-x64.deb'

But, when I used sudo apt-get install ./myproject.1.0.0.linux-x64.deb it succeeded, no idea if it's relevant to your situation.

I'm not sure what's happening on your end but this was my process:

Create a basic .NET Core 3.1 console application, and add set the RuntimeIdentifier property to linux-x64 in myproject.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
  </PropertyGroup>

</Project>

Open terminal and cd to project directory and run:

dotnet restore
dotnet publish -c Release -r linux-x64
dotnet deb -c Release -r linux-x64
cd bin/Release/netcoreapp3.1/linux-x64
sudo apt-get install ./myproject.1.0.0.linux-x64.deb

Output:

<user-name>@<host-name>:~$ cd <path-to-project>
<user-name>@<host-name>:~/<path-to-project>$ dotnet restore
  Determining projects to restore...
  Restored /home/<user-name>/<path-to-project>/myproject.csproj (in 282 ms).
<user-name>@<host-name>:~/<path-to-project>$ dotnet publish -c Release -r linux-x64
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/
<user-name>@<host-name>:~/<path-to-project>$ dotnet deb -c Release -r linux-x64
dotnet deb (0.1.171+9941587984)
Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll
  myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/
  Creating DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/'
  Created DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/'
<user-name>@<host-name>:~/<path-to-project>$ cd bin/Release/netcoreapp3.1/linux-x64
<user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ sudo apt-get install ./myproject.1.0.0.linux-x64.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'myproject' instead of './myproject.1.0.0.linux-x64.deb'
The following NEW packages will be installed:
  myproject
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/22.2 MB of archives.
After this operation, 78.2 MB of additional disk space will be used.
Get:1 /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb myproject amd64 1.0.0 [22.2 MB]
Selecting previously unselected package myproject.
(Reading database ... 169624 files and directories currently installed.)
Preparing to unpack .../myproject.1.0.0.linux-x64.deb ...
Unpacking myproject (1.0.0) ...
Setting up myproject (1.0.0) ...
<user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ which myproject
/usr/local/bin/myproject

myproject is in the PATH and executes fine.
Hello,can you help me ,how to use this Program to package Avalonia in Ubantu or, can you tell me your methods about packing.

@wuzlai commented on GitHub (Jul 18, 2020): > 建依赖关系树读取状态信息...收件人:找 > I've successfully installed the produced debian package locally under Ubuntu 20.04. > I used .NET Core 3.1.301 and published for the `linux-x64` runtime instead of `ubuntu.18.04-x64` > Is it possible for you to use the `linux-x64` runtime instead? > > Also, when I tried `sudo apt-get install myproject.1.0.0.linux-x64.deb` I got this error: > > ``` > Reading package lists... Done > Building dependency tree > Reading state information... Done > E: Unable to locate package myproject.1.0.0.linux-x64.deb > E: Couldn't find any package by glob 'myproject.1.0.0.linux-x64.deb' > E: Couldn't find any package by regex 'myproject.1.0.0.linux-x64.deb' > ``` > > But, when I used `sudo apt-get install ./myproject.1.0.0.linux-x64.deb` it succeeded, no idea if it's relevant to your situation. > > I'm not sure what's happening on your end but this was my process: > > Create a basic .NET Core 3.1 console application, and add set the `RuntimeIdentifier` property to `linux-x64` in `myproject.csproj` > > ``` > <Project Sdk="Microsoft.NET.Sdk"> > > <PropertyGroup> > <OutputType>Exe</OutputType> > <TargetFramework>netcoreapp3.1</TargetFramework> > <RuntimeIdentifier>linux-x64</RuntimeIdentifier> > </PropertyGroup> > > </Project> > ``` > > Open terminal and `cd` to project directory and run: > > ``` > dotnet restore > dotnet publish -c Release -r linux-x64 > dotnet deb -c Release -r linux-x64 > cd bin/Release/netcoreapp3.1/linux-x64 > sudo apt-get install ./myproject.1.0.0.linux-x64.deb > ``` > > Output: > > ``` > <user-name>@<host-name>:~$ cd <path-to-project> > <user-name>@<host-name>:~/<path-to-project>$ dotnet restore > Determining projects to restore... > Restored /home/<user-name>/<path-to-project>/myproject.csproj (in 282 ms). > <user-name>@<host-name>:~/<path-to-project>$ dotnet publish -c Release -r linux-x64 > Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core > Copyright (C) Microsoft Corporation. All rights reserved. > > Determining projects to restore... > All projects are up-to-date for restore. > myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll > myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/ > <user-name>@<host-name>:~/<path-to-project>$ dotnet deb -c Release -r linux-x64 > dotnet deb (0.1.171+9941587984) > Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core > Copyright (C) Microsoft Corporation. All rights reserved. > > myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.dll > myproject -> /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/publish/ > Creating DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/' > Created DEB package '/home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb' from folder 'bin/Release/netcoreapp3.1/linux-x64/publish/' > <user-name>@<host-name>:~/<path-to-project>$ cd bin/Release/netcoreapp3.1/linux-x64 > <user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ sudo apt-get install ./myproject.1.0.0.linux-x64.deb > Reading package lists... Done > Building dependency tree > Reading state information... Done > Note, selecting 'myproject' instead of './myproject.1.0.0.linux-x64.deb' > The following NEW packages will be installed: > myproject > 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. > Need to get 0 B/22.2 MB of archives. > After this operation, 78.2 MB of additional disk space will be used. > Get:1 /home/<user-name>/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64/myproject.1.0.0.linux-x64.deb myproject amd64 1.0.0 [22.2 MB] > Selecting previously unselected package myproject. > (Reading database ... 169624 files and directories currently installed.) > Preparing to unpack .../myproject.1.0.0.linux-x64.deb ... > Unpacking myproject (1.0.0) ... > Setting up myproject (1.0.0) ... > <user-name>@<host-name>:~/<path-to-project>/bin/Release/netcoreapp3.1/linux-x64$ which myproject > /usr/local/bin/myproject > ``` > > `myproject` is in the PATH and executes fine. Hello,can you help me ,how to use this Program to package Avalonia in Ubantu or, can you tell me your methods about packing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#78