Cannot find python dependency when python is installed. (Works but still gives error)
Fedora 27 both python 3 and python 2.7 available but the script fails to detect the dependency and gives an error about yum. I checked your implementation and you use yum to check if the package is installed. This doesn't work in this case though because while "dnf install python" (yum is just an alias to dnf for ages now on Fedora) installs python2, "dnf list installed python" returns nothing. "dnf list installed python2" does.
I do not know how you want to handle this as there are several options.
A) You can either detect later Fedora versions and check for python2 instead of python which just handles this case and I assume that other dnf distros that follow suit will probably be handling it the same way and fail. I see you handle Amazon like this.
B) Check the same way you do now but for both python and python2 for all rpm distros.
C) Ditch the yum check (which at some point will become obsolete/removed entirely hence it has an expiration date) and just do an "rpm -q python" followed by an "rpm -q python2" if the first check fails. Or "rpm -q {python,python2}" and parse the 2liner response.
C, in my opinion is the best option as it can be used for all redhat based distros regardless of version and if they have jumped to dnf yet or not or if they already have or will deprecate yum entirely. In this case ditching the frontend makes sense. It is only advised to use the package manager always for installing packages not for querying (in which case it's also faster to use rpm).
As a side note. It's a good idea to actually save the success detection of each of those dependencies and not check again for them every time. This will speed up the script execution by a LOT. Once the dependencies are found once, you don't need to check for them again. You can reset the detection state to check again if the script fails to start etc.. Also saving these variables, would allow a user to bypass the detection of a missing dependency (in case there's a bug/unhandled case in detection) by manually setting it as properly detected in the config file.
Can confirm having the same issue on fedora 27 as well with python installed.
[ERROR ] Starting arkserver: Checking dependencies: missing: python
Information! Automatically installing missing dependencies.
Last metadata expiration check: 2:29:31 ago on Tue 06 Feb 2018 10:03:45 PM CST.
Package python2-2.7.14-4.fc27.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
Complete! Install dependencies
I will review how CentOS and Fedora dependencies are checked
I have updated function to specify fedora as an option using python2 specifically. Also changed the check from yum to rpm. Thank you for your feedback. Fix will be available in next release
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.