我正在运行 Fedora 容器:
podman run -it registry.fedoraproject.org/fedora:36
在这个容器内,我首先安装recode
:
[root@388e917ba8ce /]# sudo dnf install recode
然后,当尝试执行时recode
,我收到此错误:
[root@388e917ba8ce /]# touch deleteme.txt
[root@388e917ba8ce /]# recode windows1251..utf8 deleteme.txt
recode: /deleteme.txt failed: System detected problem in step `CP1251..UTF-8'
什么可能导致此错误?
请注意,当我recode
在 Fedora 36 系统(没有容器)中运行时,我没有收到任何错误。另外,如果我使用 Ubuntu 映像,我也不会收到该错误。
答案1
共享库/usr/lib64/gconv/CP1251.so提供编码 CP1251 的功能。
$ podman run -it registry.fedoraproject.org/fedora:36
[root@ea7d9d4dd16b /]# dnf provides /usr/lib64/gconv/CP1251.so
Fedora 36 - x86_64 17 MB/s | 81 MB 00:04
Fedora 36 openh264 (From Cisco) - x86_64 3.5 kB/s | 2.5 kB 00:00
Fedora Modular 36 - x86_64 2.0 MB/s | 2.4 MB 00:01
Fedora 36 - x86_64 - Updates 11 MB/s | 19 MB 00:01
Fedora Modular 36 - x86_64 - Updates 1.8 MB/s | 2.2 MB 00:01
glibc-gconv-extra-2.35-4.fc36.x86_64 : All iconv converter modules for glibc.
Repo : fedora
Matched from:
Filename : /usr/lib64/gconv/CP1251.so
glibc-gconv-extra-2.35-11.fc36.x86_64 : All iconv converter modules for glibc.
Repo : updates
Matched from:
Filename : /usr/lib64/gconv/CP1251.so
[root@ea7d9d4dd16b /]#
文件/usr/lib64/gconv/CP1251.so由RPM包提供glibc-gconv-额外。
运行后dnf install -y recode glibc-gconv-extra
似乎有效
[root@ea7d9d4dd16b /]# touch deleteme.txt
[root@ea7d9d4dd16b /]# recode windows1251..utf8 deleteme.txt
[root@ea7d9d4dd16b /]#