client icon indicating copy to clipboard operation
client copied to clipboard

Simplify linux install instuctions by retreving the os release version automaticall

Open TheOneRing opened this issue 2 years ago • 3 comments

/etc/os-release should provide us with the version needed.

The current list is more complicated than needed. image

@dschmidt @jnweiger @fmoc

TheOneRing avatar Aug 17 '21 09:08 TheOneRing

The Download installer script was an attempt to evaluate /etc/os-release . -- untested.

Not only choosing the correct version is problematic for end users. Also the number of copy & paste steps. It should be "just run this installer. It takes care of everything"

jnweiger avatar Aug 23 '21 08:08 jnweiger

Distros have failed so far to provide a reliable cross-distro mechanism to let us query such details. /etc/os-release might work on many distros (it's a FreeDesktop standard, as far as I know), though.

If we opt to use that file, we should change the repository names to make it easier to use the data within there. We don't want to parse the contents, because that'll easily increase the length of the commands quickly, which can lead to issues as well.

For reference, here's an example file:

NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Putting together a string like Ubuntu_20.04 requires parsing two values already, and we have to strip the quotes from one of them.

In any case, all commands will require validation on all releases. The /etc/os-release has many different keys and they might not be available universally...

fmoc avatar Sep 02 '21 15:09 fmoc

You don't need to parse /etc/os-release manually, you can just source it.

docker run -ti ubuntu:20.04 bash -c 'source /etc/os-release && echo "${NAME}_${VERSION_ID}"'             
Ubuntu_20.04

edit: We can start with per distro snippets instead of snippets for every distro version.

dschmidt avatar Sep 02 '21 15:09 dschmidt

Not planned

TheOneRing avatar Jan 26 '23 09:01 TheOneRing