统信UOS上批量安装惠普打印驱动后启动器没有图标的解决方法

鹏大搞运维 2024-07-12 14:45:04

原文链接:

Hello,大家好啊!今天给大家带来一篇关于在统信UOS上批量安装惠普打印驱动后启动器没有设置图标的解决方法的文章。批量安装打印驱动是企业和个人用户常见的操作,但是在安装过程中,有时会出现启动器没有设置图标的问题。本文将详细介绍如何解决这一问题,帮助大家恢复启动器图标的正常显示。欢迎大家分享转发,点个关注和在看吧!

常见原因

在批量安装惠普打印驱动后,启动器没有设置图标的问题可能是由以下几个原因导致的:

图标文件丢失:安装过程中,图标文件可能未正确复制到系统目录。

启动器配置错误:启动器的配置文件中可能缺少对图标的引用。

缓存问题:图标缓存未更新,导致图标未能正确显示。

配置文件设置隐藏:配置文件中设置了隐藏选项。

1.查看系统信息

pdsyw@pdsyw-PC:~/Desktop$ cat /etc/os-version pdsyw@pdsyw-PC:~/Desktop$ uname -a

正常情况下

1.通过商店安装

2.启动器里有图标

3.查看配置文件

pdsyw@pdsyw-PC:~/Desktop$ sudo -i请输入密码:验证成功root@pdsyw-PC:~# cd /usr/share/applications/root@pdsyw-PC:/usr/share/applications# ls -ltr |grep hp.hplrwxrwxrwx 1 root root 68 7月 8 18:41 com.hp.hp-uiscan.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-uiscan.desktoplrwxrwxrwx 1 root root 67 7月 8 18:41 com.hp.hp-setup.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-setup.desktoplrwxrwxrwx 1 root root 68 7月 8 18:41 com.hp.hp-plugin.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-plugin.desktoplrwxrwxrwx 1 root root 64 7月 8 18:41 com.hp.hplip.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hplip.desktoproot@pdsyw-PC:/usr/share/applications#

4.随机查看配置文件内容

root@pdsyw-PC:/usr/share/applications# cat com.hp.hplip.desktop [Desktop Entry]Encoding=UTF-8Type=ApplicationName=HP Device ManagerGenericName=Printer Management ApplicationComment=View device status, ink levels and perform maintenance.Exec=/opt/hp/hplip/bin/toolbox.pyIcon=/opt/apps/com.hp.hplip/entries/icons/hicolor/128x128/hp_logo.pngTerminal=falseCategories=Application;Utility;X-KDE-StartupNotify=falseStartupNotify=falseComment[zh_CN]=查看设备状态,墨水量并执行维护。GenericName[zh_CN]=打印机管理应用程序Name[zh_CN]=HP 设备管理器root@pdsyw-PC:/usr/share/applications#

Encoding=UTF-8:指定文件的编码格式为 UTF-8。

Type=Application:指定这个条目类型为应用程序。

Name=HP Device Manager:应用程序的名称为 "HP Device Manager"。

GenericName=Printer Management Application:应用程序的通用名称为 "Printer Management Application"(打印机管理应用程序)。

Comment=View device status, ink levels and perform maintenance.:应用程序的简短描述,解释了该应用的功能:查看设备状态、墨水量并执行维护。

Exec=/opt/hp/hplip/bin/toolbox.py:指定了应用程序的可执行文件路径,启动该应用时运行 /opt/hp/hplip/bin/toolbox.py。

Icon=/opt/apps/com.hp.hplip/entries/icons/hicolor/128x128/hp_logo.png:指定了应用程序的图标路径,图标文件位于 /opt/apps/com.hp.hplip/entries/icons/hicolor/128x128/hp_logo.png。

Terminal=false:指定应用程序是否需要在终端中运行,此处设置为 false,表示不需要终端。

Categories=Application;Utility;:指定应用程序所属的类别,这里为 "Application" 和 "Utility"(实用工具)。

X-KDE-StartupNotify=false:KDE 桌面环境专用的配置,指定是否启用启动通知,这里设置为 false。

StartupNotify=false:指定应用程序启动时是否显示启动通知,这里设置为 false。

Comment[zh_CN]=查看设备状态,墨水量并执行维护。:中文简体(zh_CN)环境下的应用程序描述,内容为查看设备状态,墨水量并执行维护。

GenericName[zh_CN]=打印机管理应用程序:中文简体(zh_CN)环境下的通用名称,内容为打印机管理应用程序。

Name[zh_CN]=HP 设备管理器:中文简体(zh_CN)环境下的应用程序名称,内容为 HP 设备管理器。

非正常情况下

1.清理缓存目录

pdsyw@pdsyw-PC:~/Desktop$ sudo -iroot@pdsyw-PC:~# cd /var/cache/apt/archives/root@pdsyw-PC:/var/cache/apt/archives# root@pdsyw-PC:/var/cache/apt/archives# ls -ltr总用量 36456-rw-r--r-- 1 root root 35402416 7月 2 2021 com.qq.weixin_2.0.0-2_amd64.deb-rw-r--r-- 1 root root 425918 6月 11 18:29 gconf-service_3.2.6.1-deepin1_amd64.deb-rw-r--r-- 1 root root 1051514 6月 11 18:29 gconf2-common_3.2.6.1-deepin1_all.deb-rw-r--r-- 1 root root 438490 6月 11 18:29 libgconf-2-4_3.2.6.1-deepin1_amd64.deb-rw-r----- 1 root root 0 7月 2 21:54 lockdrwx------ 2 _apt root 4096 7月 4 19:21 partialroot@pdsyw-PC:/var/cache/apt/archives# root@pdsyw-PC:/var/cache/apt/archives# rm -rf *.debroot@pdsyw-PC:/var/cache/apt/archives#

2.下载离线包

root@pdsyw-PC:/var/cache/apt/archives# apt install com.hp.hplip -d -y

3.拷贝安装包到内网安装

pdsyw@pdsyw-PC:~/Desktop$ sudo dpkg -i com.hp.hplip_3.23.5.3_amd64.deb

4.启动器无图标

5.查看配置文件

pdsyw@pdsyw-PC:~/Desktop$ sudo -iroot@pdsyw-PC:~# cd /usr/share/applications/root@pdsyw-PC:/usr/share/applications# root@pdsyw-PC:/usr/share/applications# ls -ltr |grep hp.hplrwxrwxrwx 1 root root 68 7月 8 18:47 com.hp.hp-uiscan.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-uiscan.desktoplrwxrwxrwx 1 root root 67 7月 8 18:47 com.hp.hp-setup.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-setup.desktoplrwxrwxrwx 1 root root 68 7月 8 18:47 com.hp.hp-plugin.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hp-plugin.desktoplrwxrwxrwx 1 root root 64 7月 8 18:47 com.hp.hplip.desktop -> /opt/apps/com.hp.hplip/entries/applications/com.hp.hplip.desktoproot@pdsyw-PC:/usr/share/applications#

6.配置文件中多一行NoDisplay

root@pdsyw-PC:/usr/share/applications# cat com.hp.hplip.desktop [Desktop Entry]Encoding=UTF-8Type=ApplicationName=HP Device ManagerGenericName=Printer Management ApplicationComment=View device status, ink levels and perform maintenance.Exec=/opt/hp/hplip/bin/toolbox.pyIcon=/opt/apps/com.hp.hplip/entries/icons/hicolor/128x128/hp_logo.pngTerminal=falseCategories=Application;Utility;X-KDE-StartupNotify=falseStartupNotify=falseComment[zh_CN]=查看设备状态,墨水量并执行维护。GenericName[zh_CN]=打印机管理应用程序Name[zh_CN]=HP 设备管理器NoDisplay=trueroot@pdsyw-PC:/usr/share/applications#

NoDisplay=true:指定该应用程序不在应用程序菜单中显示。

解决方法

1.删除NoDisplay行

root@pdsyw-PC:/usr/share/applications# vim com.hp.hplip.desktop root@pdsyw-PC:/usr/share/applications# cat com.hp.hplip.desktop [Desktop Entry]Encoding=UTF-8Type=ApplicationName=HP Device ManagerGenericName=Printer Management ApplicationComment=View device status, ink levels and perform maintenance.Exec=/opt/hp/hplip/bin/toolbox.pyIcon=/opt/apps/com.hp.hplip/entries/icons/hicolor/128x128/hp_logo.pngTerminal=falseCategories=Application;Utility;X-KDE-StartupNotify=falseStartupNotify=falseComment[zh_CN]=查看设备状态,墨水量并执行维护。GenericName[zh_CN]=打印机管理应用程序Name[zh_CN]=HP 设备管理器root@pdsyw-PC:/usr/share/applications#

2.注销登录

3.重新登录后启动器有图标

4.其余配置文件也删除NoDisplay行

pdsyw@pdsyw-PC:~/Desktop$ sudo vim /usr/share/applications/com.hp.hp-uiscan.desktop 请输入密码:验证成功pdsyw@pdsyw-PC:~/Desktop$ sudo vim /usr/share/applications/com.hp.hp-setup.desktop pdsyw@pdsyw-PC:~/Desktop$ sudo vim /usr/share/applications/com.hp.hp-plugin.desktop pdsyw@pdsyw-PC:~/Desktop$

5.注销登录

6.启动器中四个图标都有

通过本文的介绍,您应该已经了解了在统信UOS上批量安装惠普打印驱动后解决启动器没有设置图标的方法。无论是检查图标文件、编辑启动器配置文件,还是更新图标缓存和重建应用程序菜单,这些方法都可以帮助您恢复启动器图标的正常显示。如果您觉得这篇文章有用,请分享和转发。同时,别忘了点个关注和在看,以便未来获取更多实用的技术信息和解决方案。感谢大家的阅读,我们下次再见!

0 阅读:0

鹏大搞运维

简介:感谢大家的关注