diff --git a/python-ansi2html.changes b/python-ansi2html.changes
index 5d5e6cd..49e0779 100644
--- a/python-ansi2html.changes
+++ b/python-ansi2html.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Jun 16 12:20:51 UTC 2025 - Markéta Machová
+
+- Convert to libalternatives
+
-------------------------------------------------------------------
Sun Jun 23 07:43:43 UTC 2024 - Johannes Kastl
diff --git a/python-ansi2html.spec b/python-ansi2html.spec
index a69fb97..d2cb8eb 100644
--- a/python-ansi2html.spec
+++ b/python-ansi2html.spec
@@ -1,7 +1,7 @@
#
# spec file for package python-ansi2html
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
#
+%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-ansi2html
Version: 1.9.2
@@ -29,10 +30,10 @@ BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
+BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires: alts
BuildArch: noarch
%python_subpackages
@@ -61,11 +62,8 @@ sed -i 's:from mock:from unittest.mock:' tests/test_ansi2html.py
# but it runs just ansi2html --version
%pytest -k 'not test_command_script'
-%post
-%python_install_alternative ansi2html
-
-%postun
-%python_uninstall_alternative ansi2html
+%pre
+%python_libalternatives_reset_alternative ansi2html
%files %{python_files}
%license LICENSE