我刚刚从我的Ubuntu16.04LTS系统中删除了LibreOffice的deb包
sudo apt purge --auto-remove $(dpkg -l | grep "^ii libreoffice" | awk '{print $2}')将其替换为FlatPak版本
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.libreoffice.LibreOffice然后重新启动系统,以确保应用了所有更改。然后,将LibreOffice列为已安装的
$ flatpak列表\ grep libreoffice LibreOffice org.libreoffice.LibreOffice 7.0.3.1稳定用户
它在XDG菜单中注册,我可以用它打开ODT文件。
以前,我有在无头模式下调用LibreOffice的脚本,如下所示
libreoffice --headless --convert-to pdf filename.docx但就目前而言,它们不起作用。
当我试图在终端中运行这个命令时,它说:
$ libreoffice程序'libreoffice‘目前尚未安装。您可以通过键入: sudo apt公共来安装它。
因此,它没有看到LibreOffice通过FlatPak安装:
$ echo $PATH \ grep平台$
更新回复Kulfy的评论:
$ LC_ALL=C ls -al ~/.-al/share/flatpak/exports/bin共计28 drwxrwxr-x2用户4096 11月26日15:57。drwxrwxr-x4用户4096 2月7日2019年lrwxrwxrwx 1用户用户83六月7 13:18 ../../app/com.github.bcedu.vgrive/current/active/export/bin/com.github.bcedu.vgrive com.github.bcedu.vgrive -> lrwxrwxrwx 1用户71 2020年5月24日com.snes9x.Snes9x -> lrwxrwxrwx 1用户79 10月2日23:11 org.inkscape.Inkscape -> ././app/app/org.inkscape.Inkscape/current/active/export/bin/org.inkscape.Inkscape lrwxrwxrwx 1用户用户69六月10 16:29 org.kde.kdenlive -> lrwxrwxrwx 1用户81 2月7日org.libretro.RetroArch -> ../../app/org.libretro.RetroArch/current/active/export/bin/org.libretro.RetroArch
^如您所见,没有导出LibreOffice。
我应该手动配置一些东西吗?
小提示: LibreOffice的快速安装通常会在/snap/bin/libreoffice注册libreoffice,这是在$PATH变量中。
发布于 2020-11-26 19:40:36
谢谢他的想法的@钒。
我为~/.bashrc文件创建了一个“智能”片段:
# hack for libreoffice
if [[ ! -f /usr/bin/libreoffice ]] && [[ ! -f /snap/bin/libreoffice ]]
then
flatpak info org.libreoffice.LibreOffice > /dev/null && \
alias libreoffice='/usr/bin/flatpak run org.libreoffice.LibreOffice "$@"'
fi它检查deb和snap安装的LibreOffice是否存在,如果存在FlatPak安装的LibreOffice,则为libreoffice命令定义别名。
上面的片段并不是通用的,在我的一些脚本中,我也直接调用了lowriter、localc、loimpress。因此,我需要继续使用来自PPA的LibreOffice 6.2.8来保持脚本编写的简单性。
但是所有这些和与Snap相关的问题一起真的很奇怪。我知道在PPA中为16.04LTS构建本地的LTS 7是不可能的。所以我升级到18.04 LTS。目前,我看到这种快照和FlatPak的东西是不可行的。
https://askubuntu.com/questions/1295432
复制相似问题