我正在按照有关如何在 Fedora 上安装 LibreOffice 的说明进行操作,我相信这就是 Amazon Linux 2023 的底层用途:
https://tecadmin.net/install-libreoffice-on-fedora/
我可以下载并解压zip包。但是,当我运行时dnf install RPMS/*.rpm
,出现以下错误:
error: No package matches 'RPMS/libobasis7.6-base-7.6.4.1-1.x86_64.rpm'
RPMS文件夹内容如下:
-rw-rw-r-- 1 root root 1237800 Dec 1 10:51 libobasis7.6-base-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 7643097 Dec 1 10:51 libobasis7.6-calc-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 91309240 Dec 1 10:54 libobasis7.6-core-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 6407 Dec 1 10:52 libobasis7.6-draw-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 81581 Dec 1 10:52 libobasis7.6-en-US-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 404419 Dec 1 10:51 libobasis7.6-extension-beanshell-script-provider-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 642636 Dec 1 10:51 libobasis7.6-extension-javascript-script-provider-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 1998248 Dec 1 10:52 libobasis7.6-extension-mediawiki-publisher-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 1067433 Dec 1 10:52 libobasis7.6-extension-nlpsolver-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 3329870 Dec 1 10:51 libobasis7.6-extension-pdf-import-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2971346 Dec 1 10:52 libobasis7.6-extension-report-builder-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2959808 Dec 1 10:52 libobasis7.6-firebird-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 610717 Dec 1 10:54 libobasis7.6-gnome-integration-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 1222506 Dec 1 10:51 libobasis7.6-graphicfilter-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 61644927 Dec 1 10:51 libobasis7.6-images-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 191522 Dec 1 10:51 libobasis7.6-impress-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2340064 Dec 1 10:51 libobasis7.6-kde-integration-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 208326 Dec 1 10:51 libobasis7.6-librelogo-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 3718 Dec 1 10:51 libobasis7.6-libreofficekit-data-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 538291 Dec 1 10:51 libobasis7.6-math-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 157039 Dec 1 10:52 libobasis7.6-ogltrans-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 125283 Dec 1 10:51 libobasis7.6-onlineupdate-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 17292382 Dec 1 10:51 libobasis7.6-ooofonts-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2757 Dec 1 10:51 libobasis7.6-ooolinguistic-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2025230 Dec 1 10:51 libobasis7.6-postgresql-sdbc-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 13292 Dec 1 10:51 libobasis7.6-python-script-provider-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 9795742 Dec 1 10:51 libobasis7.6-pyuno-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 3952315 Dec 1 10:51 libobasis7.6-writer-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 420612 Dec 1 10:51 libobasis7.6-xsltfilter-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 576247 Dec 1 10:52 libreoffice7.6-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2347 Dec 1 10:51 libreoffice7.6-base-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2343 Dec 1 10:51 libreoffice7.6-calc-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 5682300 Dec 1 10:51 libreoffice7.6-dict-en-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2780003 Dec 1 10:51 libreoffice7.6-dict-es-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 1857501 Dec 1 10:51 libreoffice7.6-dict-fr-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2347 Dec 1 10:51 libreoffice7.6-draw-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 7518 Dec 1 10:52 libreoffice7.6-en-US-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 752859 Dec 1 09:09 libreoffice7.6-freedesktop-menus-7.6.4-1.noarch.rpm
-rw-rw-r-- 1 root root 2382 Dec 1 10:54 libreoffice7.6-impress-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2347 Dec 1 10:52 libreoffice7.6-math-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 14441942 Dec 1 10:52 libreoffice7.6-ure-7.6.4.1-1.x86_64.rpm
-rw-rw-r-- 1 root root 2369 Dec 1 10:54 libreoffice7.6-writer-7.6.4.1-1.x86_64.rpm
看来丢失的文件确实存在,但我无法安装 LibreOffice。
这是我的 dockerfile,我正在 Apple M3 Macbook 上执行此文件:
FROM --platform=linux/amd64 public.ecr.aws/lambda/python:3.12
RUN dnf install \
gzip \
wget \
tar \
-y && \
dnf clean all
RUN wget https://download.documentfoundation.org/libreoffice/stable/7.6.4/rpm/x86_64/LibreOffice_7.6.4_Linux_x86-64_rpm.tar.gz
RUN tar -xvf LibreOffice_7.6.4_Linux_x86-64_rpm.tar.gz
RUN cd LibreOffice_7.6.4.1_Linux_x86-64_rpm/
RUN dnf install RPMS/*.rpm
答案1
更多信息(例如您正在运行的命令以及从这些命令中获得的完整错误)将很有帮助。虽然我想我知道你的问题可能是什么。
RUN
Dockerfile 中的每个命令都是一个不同的 shell 会话,因此您cd
不会进入下一个会话,并且您将被放回工作目录。
尝试将这两个命令组合成一个RUN
语句:
RUN cd LibreOffice_7.6.4.1_Linux_x86-64_rpm/ && dnf install RPMS/*.rpm
cd
或者根本不使用:
RUN dnf install LibreOffice_7.6.4.1_Linux_x86-64_rpm/RPMS/*.rpm