在 Debian 上“打包 AppImage”通常有两种理解:
下面分别说明。
sudo apt update
sudo apt install -y libfuse2 wget git build-essential
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
(可选插件)
wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage
假设你的程序叫 myapp:
myapp/
├── usr/
│ ├── bin/myapp
│ └── share/applications/myapp.desktop
│ └── share/icons/hicolor/256x256/apps/myapp.png
示例 desktop 文件:
[Desktop Entry]
Name=MyApp
Exec=myapp
Icon=myapp
Type=Application
Categories=Utility;
./linuxdeploy-x86_64.AppImage \
--appdir myapp \
--output appimage
成功后你会得到:
MyApp-x86_64.AppImage
如果你已经有 .AppImage,想让它出现在菜单中:
mkdir -p myapp-deb/opt/myapp
mkdir -p myapp-deb/usr/share/applications
cp MyApp-x86_64.AppImage myapp-deb/opt/myapp/
chmod +x myapp-deb/opt/myapp/MyApp-x86_64.AppImage
cat > myapp-deb/usr/share/applications/myapp.desktop <<EOF
[Desktop Entry]
Name=MyApp
Exec=/opt/myapp/MyApp-x86_64.AppImage
Icon=myapp
Type=Application
Categories=Utility;
EOF
sudo apt install dpkg-dev
dpkg-deb --build myapp-deb
得到:
myapp-deb.deb
libfuse2如果你能说明:
我可以给你更精确的打包示例。