Docker部署Calibre Web遇xdg-icon-resource缺失错误求助
环境信息
- 主机系统:Ubuntu 22.04
- 设备:Hewlett Packard Enterprise ProLiant ML350p Gen8
问题现象
启动Calibre Web容器时出现桌面集成设置失败的警告,核心错误为找不到xdg-icon-resource命令,完整启动日志如下:
Setting up libedit2:amd64 (3.1-20210910-1build1) ... Setting up libsensors-config (1:3.6.0-7ubuntu1) ... Setting up xkb-data (2.33-1) ... Setting up libxcb-shm0:amd64 (1.14-3ubuntu3) ... Setting up libopengl0:amd64 (1.4.0-1) ... Setting up libxxf86vm1:amd64 (1:1.1.4-1build3) ... Setting up libxcb-present0:amd64 (1.14-3ubuntu3) ... Setting up libxfixes3:amd64 (1:6.0.0-1) ... Setting up libxcb-sync1:amd64 (1.14-3ubuntu3) ... Setting up xz-utils (5.2.5-2ubuntu1) ... update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist Setting up libsensors5:amd64 (1:3.6.0-7ubuntu1) ... Setting up libglapi-mesa:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Setting up libxcb-dri2-0:amd64 (1.14-3ubuntu3) ... Setting up libxshmfence1:amd64 (1.3-1build4) ... Setting up libllvm15:amd64 (1:15.0.6-3~ubuntu0.22.04.2) ... Setting up libdrm-common (2.4.113-2~ubuntu0.22.04.1) ... Setting up libelf1:amd64 (0.186-1build1) ... Setting up libxkbcommon0:amd64 (1.4.0-1) ... Setting up libwayland-client0:amd64 (2.4.113-2~ubuntu0.22.04.1) ... Setting up libdrm2:amd64 (2.4.113-2~ubuntu0.22.04.1) ... Setting up libdrm-amdgpu1:amd64 (2.4.113-2~ubuntu0.22.04.1) ... Setting up libdrm-nouveau2:amd64 (2.4.113-2~ubuntu0.22.04.1) ... Setting up libgbm1:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Setting up libdrm-radeon1:amd64 (2.4.113-2~ubuntu0.22.04.1) ... Setting up libgl1-mesa-dri:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Setting up libegl-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Setting up libegl1:amd64 (1.4.0-1) ... Setting up libglx-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Setting up libglx0:amd64 (1.4.0-1) ... Setting up libgl1:amd64 (1.4.0-1) ... Setting up libgl1-mesa-glx:amd64 (22.2.5-0ubuntu0.1~22.04.1) ... Processing triggers for libc-bin (2.35-0ubuntu3.1) ... **** Installing/updating calibre **** % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 4 129M 4 6015k 0 0 3829k 0 0:00:34 0:00:01 0:00:33 6045k 15 129M 15 20.3M 0 0 8121k 0 0:00:16 0:00:02 0:00:14 10.2M 26 129M 26 34.9M 0 0 9.7M 0 0:00:13 0:00:03 0:00:10 11.6M 37 129M 37 48.6M 0 0 10.6M 0 0:00:12 0:00:04 0:00:08 12.1M 48 129M 48 62.8M 0 0 11.2M 0 0:00:11 0:00:05 0:00:06 12.5M 59 129M 59 77.4M 0 0 11.7M 0 0:00:11 0:00:06 0:00:05 14.3M 70 129M 70 91.9M 0 0 12.1M 0 0:00:10 0:00:07 0:00:03 14.3M 82 129M 82 106M 0 0 12.4M 0 0:00:10 0:00:08 0:00:02 14.3M 92 129M 92 120M 0 0 12.5M 0 0:00:10 0:00:09 0:00:01 14.3M 100 129M 100 129M 0 0 12.6M 0 0:00:10 0:00:10 --:--:-- 14.3M Creating symlinks... Symlinking /app/calibre/ebook-device to /usr/bin/ebook-device Symlinking /app/calibre/ebook-meta to /usr/bin/ebook-meta Symlinking /app/calibre/ebook-convert to /usr/bin/ebook-convert Symlinking /app/calibre/ebook-polish to /usr/bin/ebook-polish Symlinking /app/calibre/markdown-calibre to /usr/bin/markdown-calibre Symlinking /app/calibre/web2disk to /usr/bin/web2disk Symlinking /app/calibre/calibre-server to /usr/bin/calibre-server Symlinking /app/calibre/lrf2lrs to /usr/bin/lrf2lrs Symlinking /app/calibre/lrs2lrf to /usr/bin/lrs2lrf Symlinking /app/calibre/calibre-debug to /usr/bin/calibre-debug Symlinking /app/calibre/calibredb to /usr/bin/calibredb Symlinking /app/calibre/calibre-parallel to /usr/bin/calibre-parallel Symlinking /app/calibre/calibre-customize to /usr/bin/calibre-customize Symlinking /app/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata Symlinking /app/calibre/calibre-smtp to /usr/bin/calibre-smtp Symlinking /app/calibre/calibre to /usr/bin/calibre Symlinking /app/calibre/lrfviewer to /usr/bin/lrfviewer Symlinking /app/calibre/ebook-viewer to /usr/bin/ebook-viewer Symlinking /app/calibre/ebook-edit to /usr/bin/ebook-edit Setting up command-line completion... Installing zsh completion to: /usr/share/zsh/vendor-completions/_calibre Failed to find directory to install bash completions, using default. Installing bash completion to: /usr/share/bash-completion/completions/ Setting up desktop integration... ____________________ WARNING ____________________ Setting up desktop integration failed with error: __________________________________________________ Traceback (most recent call last): File "calibre/linux.py", line 858, in setup_desktop_integration File "calibre/linux.py", line 880, in do_setup_desktop_integration File "calibre/linux.py", line 911, in install_xdg_junk File "calibre/linux.py", line 896, in install_icons File "calibre/linux.py", line 890, in install_single_icon File "subprocess.py", line 364, in check_call File "subprocess.py", line 345, in call File "subprocess.py", line 966, in __init__ File "subprocess.py", line 1842, in _execute_child FileNotFoundError: [Errno 2] No such file or directory: 'xdg-icon-resource' Creating un-installer: /usr/bin/calibre-uninstall There were 1 warnings * Setting up desktop integration failed with error: [custom-init] No custom files found, skipping... [ls.io-init] done.
使用的docker-compose.yml配置
version: "2.1" services: calibre-web: image: lscr.io/linuxserver/calibre-web:latest container_name: calibre-web environment: - PUID=1000 - PGID=1000 - TZ=Europe/Amsterdam - DOCKER_MODS=linuxserver/mods:universal-calibre #optional - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional - UMASK=022 volumes: - /mnt/WesternDigital/Docker/calibreweb:/config - /mnt/WesternDigital/Ebooks/library:/books ports: - 8083:8083 restart: unless-stopped
已尝试方案
- 修改PUID与PGID
- 使用旧版Calibre Web Docker镜像
- 通过Portainer及手动docker-compose部署
解决方法
这个错误是因为容器内缺少xdg-utils包(xdg-icon-resource属于该包),而桌面集成对于Calibre Web的核心网页功能来说并非必需,有两种处理方式:
方式一:直接忽略警告
从日志末尾的[ls.io-init] done.可以确认容器已经正常启动,该警告仅影响桌面集成设置,不会阻碍Calibre Web的网页端功能,直接访问http://<主机IP>:8083即可使用服务。
方式二:消除警告(可选)
如果想要彻底解决这个警告,可以通过自定义启动脚本在容器启动时自动安装依赖:
- 在Calibre Web配置目录(
/mnt/WesternDigital/Docker/calibreweb)下创建custom-cont-init.d文件夹 - 在该文件夹内创建
install-xdg-utils.sh文件,内容如下:
#!/usr/bin/with-contenv bash apt-get update && apt-get install -y xdg-utils
- 给脚本添加执行权限:
chmod +x /mnt/WesternDigital/Docker/calibreweb/custom-cont-init.d/install-xdg-utils.sh
- 重启容器:
docker-compose restart calibre-web
内容的提问来源于stack exchange,提问作者Lucas
相关产品推荐
相关产品推荐

