Skip to content

Commit 1ae7205

Browse files
committed
Linux: Enhance Mariner package installation process
- Add verbose logging to Mariner package installation for better debugging - Display /etc/os-release content during installation for troubleshooting - Add makecache command before installing packages - Ensure dpkg-deb availability by installing azurelinux-repos-extended - Fix package installation command to use dpkg instead of pkg - Refactor package installation commands for clarity and efficiency
1 parent 306064d commit 1ae7205

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build.psm1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,17 +2399,22 @@ function Start-PSBootstrap {
23992399
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo $PackageManager install -y rpm-build")) -IgnoreExitcode
24002400
}
24012401
}
2402-
2402+
24032403
# For Debian-based systems and Mariner, ensure dpkg-deb is available
24042404
if ($environment.IsLinux -and ($environment.IsDebianFamily -or $environment.IsMariner)) {
24052405
Write-Verbose -Verbose "Checking for dpkg-deb..."
24062406
if (!(Get-Command dpkg-deb -ErrorAction SilentlyContinue)) {
24072407
Write-Warning "dpkg-deb not found. Installing dpkg package..."
24082408
if ($environment.IsMariner) {
24092409
# For Mariner (Azure Linux), install the extended repo first to access dpkg.
2410+
Write-Verbose -verbose "BEGIN: /etc/os-release content:"
2411+
Get-Content /etc/os-release | Write-Verbose -verbose
2412+
Write-Verbose -verbose "END: /etc/os-release content"
2413+
24102414
Write-Verbose -Verbose "Installing azurelinux-repos-extended for Mariner..."
2411-
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo $PackageManager install -y azurelinux-repos-extended")) -IgnoreExitcode
2412-
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo $PackageManager install -y dpkg")) -IgnoreExitcode
2415+
2416+
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo $PackageManager azurelinux-repos-extended")) -IgnoreExitcode -Verbose
2417+
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo $PackageManager dpkg")) -IgnoreExitcode -Verbose
24132418
} else {
24142419
Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo apt-get install -y dpkg")) -IgnoreExitcode
24152420
}

0 commit comments

Comments
 (0)