yum update error

I am using Almalinux 9 for the first time, how can I solve this problem?

Traceback (most recent call last):
  File "/usr/bin/yum", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.9/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.9/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.9/site-packages/libdnf/__init__.py", line 12, in <module>
    from . import conf
  File "/usr/lib64/python3.9/site-packages/libdnf/conf.py", line 13, in <module>
    from . import _conf
ImportError: libcurl.so.4: cannot open shared object file: No such file or directory

Is libcurl installed (rpm -qi libcurl) and does the file /usr/lib64/libcurl.so.4 exist?

The libcurl.so.4 should be a symlink to actual library file. For example:

$ ls -l /usr/lib64/libcurl.so.4
lrwxrwxrwx. 1 root root 16 Aug 19 06:36 /usr/lib64/libcurl.so.4 -> libcurl.so.4.7.0

The verify should show nothing, and the query list should show these files:

$ rpm -V libcurl
$ rpm -ql libcurl
/usr/lib/.build-id
/usr/lib/.build-id/2b
/usr/lib/.build-id/2b/afcf0c270c4dd92c5b947fe08c4314199f8cc4
/usr/lib64/libcurl.so.4
/usr/lib64/libcurl.so.4.7.0
/usr/share/licenses/libcurl
/usr/share/licenses/libcurl/COPYING

The libcurl is required by protected packages – the package should be there and no regular package removal should be possible. A (badly) failed package update could perhaps lead to missing files (although I can’t recall seeing that to happen).

I couldn’t solve the problem and reinstalled it. It’s fine now. Thanks