How To Install pre-commit on Fedora 36

In this tutorial we learn how to install pre-commit in Fedora 36. pre-commit is Framework for managing and maintaining multi-language pre-commit hooks

Introduction

In this tutorial we learn how to install pre-commit on Fedora 36.

What is pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

We can use yum or dnf to install pre-commit on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install pre-commit.

Install pre-commit on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install pre-commit using dnf by running the following command:

sudo dnf -y install pre-commit

Install pre-commit on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install pre-commit using yum by running the following command:

sudo yum -y install pre-commit

How To Uninstall pre-commit on Fedora 36

To uninstall only the pre-commit package we can use the following command:

sudo dnf remove pre-commit

pre-commit Package Contents on Fedora 36

/usr/bin/pre-commit
/usr/bin/pre-commit-validate-config
/usr/bin/pre-commit-validate-manifest
/usr/lib/python3.10/site-packages/pre_commit
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/PKG-INFO
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/SOURCES.txt
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/dependency_links.txt
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/entry_points.txt
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/requires.txt
/usr/lib/python3.10/site-packages/pre_commit-2.16.0-py3.10.egg-info/top_level.txt
/usr/lib/python3.10/site-packages/pre_commit/__init__.py
/usr/lib/python3.10/site-packages/pre_commit/__main__.py
/usr/lib/python3.10/site-packages/pre_commit/__pycache__
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/__main__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/__main__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/clientlib.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/clientlib.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/color.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/color.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/constants.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/constants.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/envcontext.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/envcontext.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/error_handler.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/error_handler.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/errors.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/errors.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/file_lock.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/file_lock.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/git.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/git.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/hook.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/hook.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/logging_handler.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/logging_handler.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/main.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/main.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/output.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/output.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/parse_shebang.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/parse_shebang.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/prefix.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/prefix.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/repository.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/repository.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/staged_files_only.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/staged_files_only.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/store.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/store.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/util.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/util.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/xargs.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/__pycache__/xargs.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/clientlib.py
/usr/lib/python3.10/site-packages/pre_commit/color.py
/usr/lib/python3.10/site-packages/pre_commit/commands
/usr/lib/python3.10/site-packages/pre_commit/commands/__init__.py
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/autoupdate.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/autoupdate.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/clean.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/clean.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/gc.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/gc.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/hook_impl.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/hook_impl.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/init_templatedir.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/init_templatedir.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/install_uninstall.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/install_uninstall.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/migrate_config.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/migrate_config.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/run.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/run.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/sample_config.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/sample_config.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/try_repo.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/__pycache__/try_repo.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/commands/autoupdate.py
/usr/lib/python3.10/site-packages/pre_commit/commands/clean.py
/usr/lib/python3.10/site-packages/pre_commit/commands/gc.py
/usr/lib/python3.10/site-packages/pre_commit/commands/hook_impl.py
/usr/lib/python3.10/site-packages/pre_commit/commands/init_templatedir.py
/usr/lib/python3.10/site-packages/pre_commit/commands/install_uninstall.py
/usr/lib/python3.10/site-packages/pre_commit/commands/migrate_config.py
/usr/lib/python3.10/site-packages/pre_commit/commands/run.py
/usr/lib/python3.10/site-packages/pre_commit/commands/sample_config.py
/usr/lib/python3.10/site-packages/pre_commit/commands/try_repo.py
/usr/lib/python3.10/site-packages/pre_commit/constants.py
/usr/lib/python3.10/site-packages/pre_commit/envcontext.py
/usr/lib/python3.10/site-packages/pre_commit/error_handler.py
/usr/lib/python3.10/site-packages/pre_commit/errors.py
/usr/lib/python3.10/site-packages/pre_commit/file_lock.py
/usr/lib/python3.10/site-packages/pre_commit/git.py
/usr/lib/python3.10/site-packages/pre_commit/hook.py
/usr/lib/python3.10/site-packages/pre_commit/languages
/usr/lib/python3.10/site-packages/pre_commit/languages/__init__.py
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/all.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/all.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/conda.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/conda.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/coursier.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/coursier.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/dart.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/dart.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/docker.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/docker.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/docker_image.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/docker_image.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/dotnet.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/dotnet.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/fail.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/fail.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/golang.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/golang.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/helpers.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/helpers.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/node.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/node.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/perl.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/perl.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/pygrep.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/pygrep.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/python.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/python.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/r.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/r.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/ruby.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/ruby.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/rust.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/rust.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/script.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/script.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/swift.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/swift.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/system.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/__pycache__/system.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/languages/all.py
/usr/lib/python3.10/site-packages/pre_commit/languages/conda.py
/usr/lib/python3.10/site-packages/pre_commit/languages/coursier.py
/usr/lib/python3.10/site-packages/pre_commit/languages/dart.py
/usr/lib/python3.10/site-packages/pre_commit/languages/docker.py
/usr/lib/python3.10/site-packages/pre_commit/languages/docker_image.py
/usr/lib/python3.10/site-packages/pre_commit/languages/dotnet.py
/usr/lib/python3.10/site-packages/pre_commit/languages/fail.py
/usr/lib/python3.10/site-packages/pre_commit/languages/golang.py
/usr/lib/python3.10/site-packages/pre_commit/languages/helpers.py
/usr/lib/python3.10/site-packages/pre_commit/languages/node.py
/usr/lib/python3.10/site-packages/pre_commit/languages/perl.py
/usr/lib/python3.10/site-packages/pre_commit/languages/pygrep.py
/usr/lib/python3.10/site-packages/pre_commit/languages/python.py
/usr/lib/python3.10/site-packages/pre_commit/languages/r.py
/usr/lib/python3.10/site-packages/pre_commit/languages/ruby.py
/usr/lib/python3.10/site-packages/pre_commit/languages/rust.py
/usr/lib/python3.10/site-packages/pre_commit/languages/script.py
/usr/lib/python3.10/site-packages/pre_commit/languages/swift.py
/usr/lib/python3.10/site-packages/pre_commit/languages/system.py
/usr/lib/python3.10/site-packages/pre_commit/logging_handler.py
/usr/lib/python3.10/site-packages/pre_commit/main.py
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__init__.py
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/check_hooks_apply.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/check_hooks_apply.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/check_useless_excludes.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/check_useless_excludes.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/identity.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/__pycache__/identity.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/check_hooks_apply.py
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/check_useless_excludes.py
/usr/lib/python3.10/site-packages/pre_commit/meta_hooks/identity.py
/usr/lib/python3.10/site-packages/pre_commit/output.py
/usr/lib/python3.10/site-packages/pre_commit/parse_shebang.py
/usr/lib/python3.10/site-packages/pre_commit/prefix.py
/usr/lib/python3.10/site-packages/pre_commit/repository.py
/usr/lib/python3.10/site-packages/pre_commit/resources
/usr/lib/python3.10/site-packages/pre_commit/resources/__init__.py
/usr/lib/python3.10/site-packages/pre_commit/resources/__pycache__
/usr/lib/python3.10/site-packages/pre_commit/resources/__pycache__/__init__.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/resources/__pycache__/__init__.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/resources/__pycache__/empty_template_setup.cpython-310.opt-1.pyc
/usr/lib/python3.10/site-packages/pre_commit/resources/__pycache__/empty_template_setup.cpython-310.pyc
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_.npmignore
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_Cargo.toml
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_LICENSE.renv
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_Makefile.PL
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_activate.R
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_environment.yml
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_go.mod
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_main.go
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_main.rs
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_package.json
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_pre_commit_placeholder_package.gemspec
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_pubspec.yaml
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_renv.lock
/usr/lib/python3.10/site-packages/pre_commit/resources/empty_template_setup.py
/usr/lib/python3.10/site-packages/pre_commit/resources/hook-tmpl
/usr/lib/python3.10/site-packages/pre_commit/resources/rbenv.tar.gz
/usr/lib/python3.10/site-packages/pre_commit/resources/ruby-build.tar.gz
/usr/lib/python3.10/site-packages/pre_commit/resources/ruby-download.tar.gz
/usr/lib/python3.10/site-packages/pre_commit/staged_files_only.py
/usr/lib/python3.10/site-packages/pre_commit/store.py
/usr/lib/python3.10/site-packages/pre_commit/util.py
/usr/lib/python3.10/site-packages/pre_commit/xargs.py
/usr/share/doc/pre-commit
/usr/share/doc/pre-commit/CHANGELOG.md
/usr/share/doc/pre-commit/CONTRIBUTING.md
/usr/share/doc/pre-commit/README.md
/usr/share/licenses/pre-commit
/usr/share/licenses/pre-commit/LICENSE

References

Summary

In this tutorial we learn how to install pre-commit on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).