Linux WSL
Ubuntu Pengwin
-
lsb_release -a
per Checking your Ubuntu Version -
cat /etc/*release
works for most distributions. - ppa:jonathonf/vim, vim-gtk3, packaging files are based on "latest" Debian/Ubuntu if a more recent version of Vim is required than provided in Ubuntu.
-
sudo hwclock --hctosys
resets system time to hardware clock time: sudo apt update error: "Release file is not yet valid".
apt
When sudo apt update && sudo apt upgrade
produces a warning similar to:
5 packages can be upgraded. Run 'apt list --upgradable' to see them. ... The following packages have been kept back: cloud-init libruby3.0 python3-update-manager ruby3.0 update-manager-core 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Update the packages individually.
sudo apt list --upgradable sudo apt install --only-upgrade <package name>
Fedora RHEL
-
cat /etc/os-release
provides detailed version information.
bash script
- Minimal safe Bash script template describes m-radzikowski/script-template.sh.
-
bashew bash script creator - from small stand-alone script to complex projects with CI/CD and testing
describes pforret / bashew.
VAR is: unset empty non-empty [ -z "${VAR}" ] true true false [ -z "${VAR+set}" ] true false false [ -z "${VAR-unset}" ] false true false [ -n "${VAR}" ] false false true [ -n "${VAR+set}" ] false true true [ -n "${VAR-unset}" ] true false true -
Associative Arrays
declare -a toinstall for key in "${!package_to_install[@]}"; do if [[ $(command -v $key) ]]; then IO:debug "${package_to_install[$key]} is already installed." else toinstall=(${toinstall[@]} ${package_to_install["$key"]}) fi done