CentOS7运行AppImage
文章目录
- CentOS7运行AppImage
- 一、前言
- 1.简介
- 2.环境
- 二、正文
- 1.切换镜像源和更新软件包
- 2.安装依赖包
- 3.下载 AppImage 软件包
- 4.指令运行
- 5.应用程序添加菜单图标
CentOS7运行AppImage
一、前言
1.简介
让 Linux 应用随处运行
- 简单
AppImage的核心思想是一个应用程序 = 一个文件 。每个AppImage都包含应用程序以及应用程序运行所需的所有文件。换句话说,除了操作系统本身的基础组件,Appimage不需要依赖包即可运行。
- 可靠
AppImage 格式是上游应用打包的理想选择,这意味着你可以直接从开发者那里获取软件,而不需要任何中间步骤,这完全符合开发者意图。非常迅速。
- 快速
AppImage应用可以直接下载并且运行,无需安装,并且不需要root权限。
2.环境
Linux 发行版:CentOS-7-x86_64-DVD-2207-02.iso
AppImage:https://appimage.org/
AppImageLauncher-GitHub:https://github.com/TheAssassin/AppImageLauncher/releases
AnotherRedisDesktopManager-GitHub:https://github.com/qishibo/AnotherRedisDesktopManager/releases
CentOS基础操作命令:https://blog.csdn.net/u011424614/article/details/94555916
CentOS对换home分区与root分区的存储空间:https://blog.csdn.net/u011424614/article/details/125853913
Dell R740安装CentOS:https://blog.csdn.net/u011424614/article/details/113306808
CentOS分区扩容:https://blog.csdn.net/u011424614/article/details/113275862
二、正文
1.切换镜像源和更新软件包
- 安装过程参考:《CentOS7切换镜像源和更新软件包》
2.安装依赖包
yum install -y fuse libX11 libXScrnSaver mesa-libGL
3.下载 AppImage 软件包
- 以 AnotherRedisDesktopManager 为例
mkdir /opt/anotherRedisDesktop
cd /opt/anotherRedisDesktopwget https://github.com/qishibo/AnotherRedisDesktopManager/releases/download/v1.7.1/Another-Redis-Desktop-Manager-linux-1.7.1-x86_64.AppImage
4.指令运行
# 授权
chmod +x Another-Redis-Desktop-Manager-linux-1.7.1-x86_64.AppImage# 运行
./Another-Redis-Desktop-Manager-linux-1.7.1-x86_64.AppImage --no-sandbox
- 启动效果
5.应用程序添加菜单图标
- 应用图标,通过解压 AppImage 文件获取
# 解压 AppImage 文件
./Another-Redis-Desktop-Manager-linux-1.7.1-x86_64.AppImage --appimage-extract# 通过快捷方式,找到图标存放位置
ls -l squashfs-root/another-redis-desktop-manager.png
# 输出:squashfs-root/another-redis-desktop-manager.png -> usr/share/icons/hicolor/0x0/apps/another-redis-desktop-manager.png# 拷贝图标
cp squashfs-root/usr/share/icons/hicolor/0x0/apps/another-redis-desktop-manager.png /opt/anotherRedisDesktop/
- 定义应用程序启动配置的标准化文件
cat > /usr/share/applications/Another-Redis-Desktop-Manager.desktop <<EOF
[Desktop Entry]
Name=Another Redis Desktop Manager
Comment=Redis Desktop Manager
Exec=/opt/anotherRedisDesktop/Another-Redis-Desktop-Manager-linux-1.7.1-x86_64.AppImage --no-sandbox
Icon=/opt/anotherRedisDesktop/another-redis-desktop-manager.png
Terminal=false
Type=Application
Categories=Development;Utility;
StartupNotify=true
EOF
- 输出文件内容
cat /usr/share/applications/Another-Redis-Desktop-Manager.desktop
- 更新 Linux 系统中
.desktop
文件的索引数据库 - 如果更新后,应用程序 的菜单还有没有,重启一下系统
update-desktop-database /usr/share/applications# 备用,非必要执行
# 删除 Linux 桌面环境中已缓存的应用程序关联信息
# 再执行 update-desktop-database /usr/share/applications
rm /usr/share/applications/mimeinfo.cache
- 最终效果