Skip to content

Allow brew doctor to work on linux #20148

Closed
@MeanderingProgrammer

Description

@MeanderingProgrammer

Verification

Provide a detailed description of the proposed feature

I know linux is not a first class citizen for homebrew, it would just be nice to use brew doctor to see outdated formulas or other potential issues.

Currently running brew doctor gives me the following error:

Error: uninitialized constant Homebrew::Diagnostic::Checks::MacOS

I'm not 100% sure if this impacts all Linux systems, but I get the same error on 3 different devices, 2 running WSL and 1 running Ubuntu. They were setup around the same time so maybe it's a side effect of that, I have not tried on a completely fresh install.

The error seems to stem from the check_cask_software_versions check, specifically this line:

add_info "macOS", MacOS.full_version

I think the fix would be to just wrap this in an if statement:

if OS.mac?
  add_info "macOS", MacOS.full_version
end

What is the motivation for the feature?

brew doctor is a useful command for debugging and finding potential issues, having it work on all supported platforms seems reasonable.

How will the feature be relevant to at least 90% of Homebrew users?

Probably not 90%, I'm not sure what the split of Linux users is, but probably useful to that percentage of users.

What alternatives to the feature have been considered?

Currently I just don't use brew doctor in debugging potential problems. The alternative is just to do nothing, it's not a particularly huge problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions