Flatpak http error in Fedora 38
After updating to Fedora 38, flatpak and gnome-software stopped working. When I executed flatpak or gnome-software, the error that appeared was:
**
flatpak:ERROR:../common/flatpak-utils-http.c:381:flatpak_create_http_session: assertion failed (rc == CURLM_OK): (48 == 0)
Bail out! flatpak:ERROR:../common/flatpak-utils-http.c:381:flatpak_create_http_session: assertion failed (rc == CURLM_OK): (48 == 0)
Looking at flatpak-utils-http.c code , in line 381:
curl_easy_setopt (curl, CURLOPT_USERAGENT, user_agent);
#if CURL_AT_LEAST_VERSION(7, 85, 0)
rc = curl_easy_setopt (curl, CURLOPT_PROTOCOLS_STR, "http,https");
#else
rc = curl_easy_setopt (curl, CURLOPT_PROTOCOLS, (long)(CURLPROTO_HTTP | CURLPROTO_HTTPS));
#endif
g_assert_cmpint (rc, ==, CURLM_OK);
The method curl_easy_setopt is executed, used to tell libcurl how to behave. Searching for the Curl Error Code 48, the error is CURLE_UNKNOWN_OPTION: “An option passed to libcurl is not recognized/known”. As my curl version doesn’t support an option, this means that I have an old curl version. So I need to check what’s the curl version:
I executed dnf info curl, it didn’t show anything:
# dnf info curl
Last metadata expiration check: 0:18:54 ago on dom 01 oct 2023 20:03:57.
Error: No matching Packages to list
Searching for rpm -qf, I found that the curl package is curl-7.71.1-9.fc33.x86_64.
# rpm -qf /usr/bin/curl
curl-7.71.1-9.fc33.x86_64
A Fedora 33 curl version is installed! I tried to uninstall it, but it returned a dependency error:
# rpm -e curl
error: Failed dependencies:
curl is needed by (installed) rpm-4.18.1-3.fc38.x86_64
curl is needed by (installed) clevis-19-2.fc38.x86_64
curl is needed by (installed) libguestfs-appliance-1:1.50.1-1.fc38.x86_64
curl is needed by (installed) rpmdevtools-9.6-3.fc38.noarch
curl is needed by (installed) guestfs-tools-1.50.1-1.fc38.x86_64
curl is needed by (installed) dracut-live-059-3.fc38.x86_64
curl is needed by (installed) libreport-plugin-kerneloops-2.17.11-1.fc38.x86_64
curl is needed by (installed) abrt-addon-kerneloops-2.17.1-1.fc38.x86_64
curl is needed by (installed) abrt-addon-xorg-2.17.1-1.fc38.x86_64
curl is needed by (installed) freeipa-client-4.10.2-1.fc38.x86_64
curl is needed by (installed) hplip-3.23.5-8.fc38.x86_64
I uninstalled curl with nodeps options:
# rpm -e curl --nodeps
I tried to install again curl, but I got more libcurl dependency errors:
# dnf install curl-minimal
Last metadata expiration check: 0:31:30 ago on dom 01 oct 2023 20:03:57.
Error:
Problem: conflicting requests
- package curl-minimal-7.87.0-7.fc38.x86_64 from fedora requires libcurl(x86-64) >= 7.87.0-7.fc38, but none of the providers can be installed
- package curl-minimal-8.0.1-4.fc38.x86_64 from updates requires libcurl(x86-64) >= 8.0.1-4.fc38, but none of the providers can be installed
- package libcurl-minimal-7.87.0-7.fc38.x86_64 from fedora conflicts with libcurl(x86-64) provided by libcurl-7.71.1-9.fc33.x86_64 from @System
- package libcurl-minimal-8.0.1-4.fc38.x86_64 from updates conflicts with libcurl(x86-64) provided by libcurl-7.71.1-9.fc33.x86_64 from @System
- problem with installed package libcurl-7.71.1-9.fc33.x86_64
- package libcurl-7.87.0-7.fc38.x86_64 from fedora is filtered out by exclude filtering
- package libcurl-8.0.1-4.fc38.x86_64 from updates is filtered out by exclude filtering
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
I uninstalled libcurl :
# rpm -e libcurl-7.71.1-9.fc33.x86_64 --nodeps
But trying to install curl, I got a dnf error because libcurl is missing:
# dnf install curl-minimal
Traceback (most recent call last):
File "/usr/bin/dnf", line 61, in <module>
from dnf.cli import main
File "/usr/lib/python3.11/site-packages/dnf/__init__.py", line 30, in <module>
import dnf.base
File "/usr/lib/python3.11/site-packages/dnf/base.py", line 29, in <module>
import libdnf.transaction
File "/usr/lib64/python3.11/site-packages/libdnf/__init__.py", line 12, in <module>
from . import conf
File "/usr/lib64/python3.11/site-packages/libdnf/conf.py", line 10, in <module>
from . import _conf
ImportError: libcurl.so.4: cannot open shared object file: No such file or directory
I downloaded Fedora 38 libcurl and copied the missing library:
$ cd /tmp
$ wget https://dl.fedoraproject.org/pub/fedora/linux/releases/38/Everything/x86_64/os/Packages/l/libcurl-7.87.0-7.fc38.x86_64.rpm
$ rpm2cpio libcurl-7.87.0-7.fc38.x86_64.rpm | cpio -idmv
$ cd usr/lib64/
$ sudo cp -r libcurl.so.4* /usr/lib64
And now I could install curl:
dnf install curl
Last metadata expiration check: 0:40:28 ago on dom 01 oct 2023 20:03:57.
Dependencies resolved.
==============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
curl-minimal x86_64 8.0.1-4.fc38 updates 149 k
Installing dependencies:
libcurl-minimal x86_64 8.0.1-4.fc38 updates 249 k
Transaction Summary
==============================================================================================================================================================================================================================================
Install 2 Packages
Total download size: 399 k
Installed size: 821 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): curl-minimal-8.0.1-4.fc38.x86_64.rpm 341 kB/s | 149 kB 00:00
(2/2): libcurl-minimal-8.0.1-4.fc38.x86_64.rpm 490 kB/s | 249 kB 00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 362 kB/s | 399 kB 00:01
And now flatpak and gnome-software is fixed!!!
NOTE: To avoid more similar errors, I searched for the fc33, fc34, fc35, fc36 and fc37 packages, and removed all of them that didn’t have any dependency.