EnsureUpdateProxmox
Ensures a Proxmox VE host is updated to the latest package and release version, including root filesystem cleanup, APT repository normalization, minor upgrades, and optional in-place major version upgrades (PVE 7 → 8 → 9).
public static class EnsureUpdateProxmox
1. Methods
1.1. BuildDebianSourcesList(int)
Builds the canonical /etc/apt/sources.list content for a given Proxmox VE major version.
public static string BuildDebianSourcesList(int pveMajor)
| Name | Type | Description |
|---|---|---|
pveMajor |
int |
Proxmox VE major version (7, 8, or 9). |
Returns: string — Debian APT sources list content.
1.2. BuildPveNoSubscriptionRepoContent(int)
Builds the Proxmox pve-no-subscription repository definition for a given major version.
public static string BuildPveNoSubscriptionRepoContent(int pveMajor)
| Name | Type | Description |
|---|---|---|
pveMajor |
int |
Proxmox VE major version (7, 8, or 9). |
Returns: string — APT repository configuration string.
1.3. FreeRootDiskSpaceAndOffloadAptCache(IProxmoxHostCommandExecutor, ILogger)
Frees disk space on the Proxmox root filesystem and offloads /var/cache/apt/archives onto /var/lib/vz/apt-archives when /var/lib/vz has larger free capacity.
public static void FreeRootDiskSpaceAndOffloadAptCache(IProxmoxHostCommandExecutor executor, ILogger logger)
| Name | Type | Description |
|---|---|---|
executor |
IProxmoxHostCommandExecutor |
Target host command executor. |
logger |
ILogger |
Logger instance. |
1.4. MapMajorToDebianSuite(int)
Maps a Proxmox VE major version to its Debian suite codename.
public static string MapMajorToDebianSuite(int pveMajor)
| Name | Type | Description |
|---|---|---|
pveMajor |
int |
Proxmox VE major version (7, 8, or 9). |
Returns: string — Debian suite codename (bullseye, bookworm, or trixie).
1.5. NormalizeAptRepositories(IProxmoxHostCommandExecutor, ILogger, int, string)
Normalizes Debian and Proxmox APT sources for pveMajor and disables enterprise repos.
public static bool NormalizeAptRepositories(IProxmoxHostCommandExecutor executor, ILogger logger, int pveMajor, out string errorMessage)
| Name | Type | Description |
|---|---|---|
executor |
IProxmoxHostCommandExecutor |
Target host command executor. |
logger |
ILogger |
Logger instance. |
pveMajor |
int |
Target Proxmox VE major version. |
errorMessage |
string |
Populated when normalization fails. |
Returns: bool — True when normalization succeeded.
1.6. Run(IProxmoxHostCommandExecutor, ILogger, ProxmoxUpdateOptions)
Runs the full Proxmox update pipeline against executor.
public static ProxmoxUpdateResult Run(IProxmoxHostCommandExecutor executor, ILogger logger, ProxmoxUpdateOptions options = null)
| Name | Type | Description |
|---|---|---|
executor |
IProxmoxHostCommandExecutor |
Command executor targeting the local or remote Proxmox host. |
logger |
ILogger |
Logger instance. |
options |
ProxmoxUpdateOptions |
Update options (defaults to |
Returns: ProxmoxUpdateResult — Structured ProxmoxUpdateResult describing the outcome.
1.7. TryParsePveMajorVersion(string, int)
Parses the Proxmox VE major version number from pveversion output (e.g. pve-manager/7.4-20/f98bf8d4 → 7).
public static bool TryParsePveMajorVersion(string pveVersionOutput, out int majorVersion)
| Name | Type | Description |
|---|---|---|
pveVersionOutput |
string |
Raw output from |
majorVersion |
int |
Parsed major version when successful. |
Returns: bool — True when a valid major version was parsed.