Canonical.Dpkg.Common 1.0.0-preview.1.20260907.3

This is a prerelease version of Canonical.Dpkg.Common.
dotnet add package Canonical.Dpkg.Common --version 1.0.0-preview.1.20260907.3
                    
NuGet\Install-Package Canonical.Dpkg.Common -Version 1.0.0-preview.1.20260907.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Canonical.Dpkg.Common" Version="1.0.0-preview.1.20260907.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Canonical.Dpkg.Common" Version="1.0.0-preview.1.20260907.3" />
                    
Directory.Packages.props
<PackageReference Include="Canonical.Dpkg.Common" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Canonical.Dpkg.Common --version 1.0.0-preview.1.20260907.3
                    
#r "nuget: Canonical.Dpkg.Common, 1.0.0-preview.1.20260907.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Canonical.Dpkg.Common@1.0.0-preview.1.20260907.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Canonical.Dpkg.Common&version=1.0.0-preview.1.20260907.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Canonical.Dpkg.Common&version=1.0.0-preview.1.20260907.3&prerelease
                    
Install as a Cake Tool

Canonical.Dpkg.Common

NuGet License: GPL-3.0-only

This packages is currently published as a pre-release version and the public API may still change. We provide no official support; issues are addressed on a best-effort basis.

Strongly-typed immutable value types, parsers, and comparison logic for core dpkg primitives: package names, machine architectures, and the full deb-version(7) version format.

Installation

dotnet add package Canonical.Dpkg.Common --prerelease

Usage

Compare two Debian package versions using deb-version(7) ordering:

using Canonical.Dpkg;

var installed = DpkgVersion.Parse("1:2.3.4-1ubuntu2");
var candidate = DpkgVersion.Parse("1:2.3.4-1ubuntu10");

Console.WriteLine(installed < candidate); // True

Parse dpkg version strings and access detailed information:

using Canonical.Dpkg;

var candidate = DpkgVersion.Parse("1:2.3.4+really3.0-1ubuntu10");

DpkgVersion.Parse("8.0.100-8.0.0~rc1+really7.0.100-7.0.0~beta1~bootstrap+amd64-0ubuntu1")
// {
//    Epoch: null
//    EpochValue: 0
//    UpstreamVersion: "8.0.100-8.0.0~rc1+really7.0.100-7.0.0~beta1~bootstrap+amd64"
//    RevertedUpstreamVersion: "8.0.100-8.0.0~rc1"
//    RealUpstreamVersion: "7.0.100-7.0.0~beta1~bootstrap+amd64"
//    EffectiveUpstreamVersion: "7.0.100-7.0.0~beta1~bootstrap+amd64"
//    Revision: "0ubuntu1"
//    DebianRevision: "0"
//    UbuntuRevision: "1"
// }

Parse/Validate dpkg package names:

// Validating parse without exceptions.
if (DpkgPackageName.TryParse("dotnet-sdk-10.0", out var name))
    Console.WriteLine(name);

Type-safe well known architectures, e.g.:

var architecture = DpkgMachineArchitectures.Amd64;

What's in this package

Type Purpose
DpkgVersion Parsing, formatting and deb-version(7)-compliant comparison of package versions.
DpkgPackageName Validated dpkg package name.
DpkgMachineArchitecture Validated dpkg machine architecture.
DpkgMachineArchitectures Well-known machine architecture values.

Contributing and support

This library is maintained on a best-effort basis and are not covered by Canonical support agreements. Bug reports and pull requests are welcome via GitHub Issues and pull requests.

License

Copyright 2026 Canonical Ltd.

SPDX-License-Identifier: GPL-3.0-only

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Canonical.Dpkg.Common:

Package Downloads
Canonical.DistroInfo

Library for querying Linux distribution release metadata. Reads distro-info-data CSV files at runtime to provide Ubuntu and Debian release information, including support status, ESM/LTS lifecycle queries and well-known identifiers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.1.20260907.3 75 9/7/2026
1.0.0-preview.1.20260907.2 69 9/7/2026
1.0.0-preview.1.20260907 65 9/7/2026