[GH-ISSUE #1779] Cannot find python dependency when python is installed. (Works but still gives error) #1391

Closed
opened 2026-02-27 02:56:50 +03:00 by kerem · 4 comments
Owner

Originally created by @Nodens- on GitHub (Jan 18, 2018).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1779

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.

Originally created by @Nodens- on GitHub (Jan 18, 2018). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1779 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.
kerem 2026-02-27 02:56:50 +03:00
Author
Owner

@DevScarabyte commented on GitHub (Feb 6, 2018):

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
<!-- gh-comment-id:363459153 --> @DevScarabyte commented on GitHub (Feb 6, 2018): 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 ```
Author
Owner

@dgibbs64 commented on GitHub (Jun 16, 2018):

I will review how CentOS and Fedora dependencies are checked

<!-- gh-comment-id:397842027 --> @dgibbs64 commented on GitHub (Jun 16, 2018): I will review how CentOS and Fedora dependencies are checked
Author
Owner

@dgibbs64 commented on GitHub (Jun 17, 2018):

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

<!-- gh-comment-id:397881606 --> @dgibbs64 commented on GitHub (Jun 17, 2018): 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
Author
Owner

@lock[bot] commented on GitHub (Jul 18, 2019):

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.

<!-- gh-comment-id:512976162 --> @lock[bot] commented on GitHub (Jul 18, 2019): 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.
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#1391
No description provided.