由于Linux系统上无RPM 工具,不支持rpm指令;
银河麒麟操作系统是基于 Debian/Ubuntu 的,主要使用 dpkg
和 apt
来管理软件包,而不是 RPM。
进入google文件夹下,安装指令使用dpkg
sudo dpkg -i google-chrome-stable_current_amd64.deb
先通过指令找到谷歌安装位置
which google-chrome
检查依赖项
确保所有必要的依赖库都已经正确安装。有时候缺少某些库会导致程序无法正常启动。
更新包列表并安装缺失的依赖:
sudo apt update
sudo apt update sudo apt install libnss3 libgconf-2-4
清除缓存和配置文件
mv ~/.config/google-chrome ~/.config/google-chrome.bak
使用创建.desktop 文件方法
在银河麒麟V10 SP1系统中,可以通过创建一个.desktop 文件来实现在开机后自动运行一个shell脚
进入~/.config/autostart/目录下
#进入后台服务器的根目录
XXXXXZ-pc:-pc:/$ ls
bin cdrom deb etc lib lib64 log1 media opt root sbin sys usr
boot data dev home lib32 libx32 lost found mnt proc run srv tmp var
XXXXXZ-pc:-pc:/$ cd ~/.config/autostart/
XXXXXZ-pc:-pc:~/.config/autostart$
创建.desktop文件,使用nano指令,进入文件内容页,可以通过按 Ctrl O 保存文件,然后按 Ctrl X 退出编辑器
XXXXXZ-pc:nano ~/.config/autostart/test.desktop
XXXXXZ-pc:~/.config/autostart$ ls
test.desktop
编辑test.desktop的内容
XXXXX-pc:~/.config/autostart$ vim test.desktop
[Desktop Entry]
Name=start-chrome-m6930z
Exec=/bin/bash /usr/share/applications/test.sh
Terminal=true
Type=Application
使用vim指令,进入内容页后在键盘上按字母i,进入编辑状态,填写完内容后,先按esc,再:wq(代表保存更新的内容)
在/usr/share/applications/下创建.sh文件start-chrome-m6930z.sh
XXXXX-pc:/$ nano /usr/share/applications/start-chrome-m6930z.sh
XXXXX-pc:/$ sudo vim /usr/share/applications/test.sh
#/bin/bash
/usr/bin/google-chrome-stable --noerrdialogs --start-fullscreen http://localhost:7081/index.html