-
Notifications
You must be signed in to change notification settings - Fork 193
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
Update install_dependencies.sh #828
Conversation
$VERSION_ID returns the Ubuntu distribution version. We want the base Ubuntu version. Example - Running Linux Mint (Vera): $VERSION_ID returns 21.1 - which is the Mint version number But the distro is based on 22.04, so the script errors out. "inxi -Sx | grep -oP '(?<=Ubuntu\s)\d+\.\d+')" correctly returns 22.04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my Ubuntu20.04 inxi
is neither installed, nor it returns anything "Ubuntu" like as text.
This will have to be addressed differently
@@ -112,7 +112,8 @@ elif [ -f /etc/os-release ]; then | |||
if [[ "$ID" == "ubuntu" || "$ID" == "debian" || "$ID_LIKE" == "ubuntu" || "$ID_LIKE" == "debian" || "$ID_LIKE" == "ubuntu debian" ]]; then | |||
if [[ ! $(uname -m) =~ ^arm* ]]; then | |||
sudo apt-get update | |||
if [[ "$VERSION_ID" > "22.04" || "$VERSION_ID" == "22.04" ]]; then | |||
UBUNTU_VERSION=$(inxi -Sx | grep -oP '(?<=Ubuntu\s)\d+\.\d+') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inxi is not a default tool
consider something like
UBUNTU_VERSION=$(inxi -Sx | grep -oP '(?<=Ubuntu\s)\d+\.\d+') | |
UBUNTU_VERSION=$(cat /etc/lsb-release | awk -F '=' '/^DISTRIB_RELEASE=/ {{ print $2 }}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AnesHadzi,
the /etc/lsb-release doesn't return the correct version on Ubuntu Mint (I get 21.1 codename Vera). The correct info can be found in /etc/upstream-release/lsb-release, but I have checked that stock Ubuntu doesn't have that directory. I'm looking for something that would work across all platofrms, but haven't found anything just yet.
Thanks,
Jaka
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have Mint to try, but IIRC ID from etc/os-release should say something like mint, and the system already relies on that param, you can do:
add if [Mint] cat /etc/upstream-release/lsb-release
$VERSION_ID
returns the Ubuntu distribution version. We want the base Ubuntu version.Example - Running Linux Mint (Vera):
$VERSION_ID
returns 21.1 - which is the Mint version number, but the distro is based on 22.04, so the script errors out.inxi -Sx | grep -oP '(?<=Ubuntu\s)\d+\.\d+')
correctly returns 22.04