Skip to content
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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/_static/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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+')

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

Suggested change
UBUNTU_VERSION=$(inxi -Sx | grep -oP '(?<=Ubuntu\s)\d+\.\d+')
UBUNTU_VERSION=$(cat /etc/lsb-release | awk -F '=' '/^DISTRIB_RELEASE=/ {{ print $2 }}')

Copy link
Contributor Author

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

Copy link

@AnesHadzi AnesHadzi Jun 4, 2023

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

if [[ "$UBUNTU_VERSION" > "22.04" || "$UBUNTU_VERSION" == "22.04" ]]; then
sudo apt-get install -y "${ubuntu_pkgs_post22_04[@]}"
else
sudo apt-get install -y "${ubuntu_pkgs_pre22_04[@]}"
Expand Down
Loading