我正在运行 Arch Linux 和 KDE,并且正在探索 mime 类型在我的系统上的行为(和行为不端)。
考虑这种 mime 类型的文件关联。以下控制台输出显示我有 mime-type xml 定义文件,并且.pub
文件和 mime-type之间存在关联application/vnd.ms-publisher
。
$ xdg-mime query filetype ~/.ssh/id_rsa_test.pub
application/vnd.ms-publisher
$ less mimeapps.list
[Added Associations]
application/vnd.ms-publisher=org.kde.kate.desktop;
# find /usr -name vnd.ms-publisher.xml
/usr/share/mime/application/vnd.ms-publisher.xml
# less /usr/share/mime/application/vnd.ms-publisher.xml
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/vnd.ms-publisher">
<!--Created automatically by update-mime-database. DO NOT EDIT!-->
<sub-class-of type="application/x-ole-storage"/>
<glob pattern="*.pub"/>
</mime-type>
(我不喜欢 ms-publisher 与我的 Linux 系统上的公钥相关联的事实,但这是另一个问题的主题。)
从上面可以看出,一切都井井有条。
接下来我决定为 Kate(文本编辑器)添加一个关联来处理.pub
公钥文件。我使用 KDE 系统设置 > 应用程序 > 文件关联创建了它。
这个屏幕截图显示了我所做的。当我单击“应用”时,进度对话框会短暂出现,并且操作似乎已成功。
然而,在重新访问同一个对话框时,我刚刚添加的 Kate 关联消失了。“应用程序优先顺序”下的框为空。
我的问题是:是什么导致此文件关联无法保存,我该如何解决?
检查journalctl -r
我发现以下消息(以相反的顺序)。所有行都以前缀 simlarl 开头,Jan 31 17:24:18 laptop systemsettings5[20318]
但我删除了大部分以节省空间。
Jan 31 17:24:19 laptop systemsettings5[20318]: Mimetype Comment Dirty: old= "Kindle book document" m_comment= "Amazon KF8 ebook format"
Jan 31 17:24:19 laptop systemsettings5[20318]: Mimetype Comment Dirty: old= "ODB database" m_comment= "OpenDocument Database"
Jan 31 17:24:19 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:24:19 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:24:19 laptop systemsettings5[20318]: ("services", "servicetypes", "xdgdata-mime", "apps")
...
Jan 31 17:24:18 laptop systemsettings5[20318]: "application/vnd.ms-publisher" hasDefinitionFile: false
kf5.kservice.sycoca: Service type not found: "audio/x-xm"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.presentation-template"
kf5.kservice.sycoca: Service type not found: "text/x-rst"
kf5.kservice.sycoca: Service type not found: "application/pdf"
kf5.kservice.sycoca: Service type not found: "application/x-bzip"
kf5.kservice.sycoca: Service type not found: "application/x-cue"
kf5.kservice.sycoca: Service type not found: "image/x-rgb"
kf5.kservice.sycoca: Service type not found: "application/x-gzpdf"
kf5.kservice.sycoca: Service type not found: "application/x-cmakecache"
kf5.kservice.sycoca: Service type not found: "image/x-sigma-x3f"
kf5.kservice.sycoca: Service type not found: "application/x-tellico"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.spreadsheet-flat-xml"
kf5.kservice.sycoca: Service type not found: "application/x-mswrite"
kf5.kservice.sycoca: Service type not found: "application/x-t602"
kf5.kservice.sycoca: Service type not found: "image/x-nikon-nef"
kf5.kservice.sycoca: Service type not found: "video/x-flic"
kf5.kservice.sycoca: Service type not found: "x-content/video-vcd"
kf5.kservice.sycoca: Service type not found: "audio/flac"
kf5.kservice.sycoca: Service type not found: "application/xspf+xml"
kf5.kservice.sycoca: Service type not found: "image/svg+xml"
kf5.kservice.sycoca: Service type not found: "application/x-tar"
kf5.kservice.sycoca: Service type not found: "image/x-xpixmap"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.calc"
kf5.kservice.sycoca: Service type not found: "application/gzip"
kf5.kservice.sycoca: Service type not found: "application/x-zip-compressed-fb2"
kf5.kservice.sycoca: Service type not found: "application/x-compressed-tar"
kf5.kservice.sycoca: Service type not found: "audio/x-wavpack"
kf5.kservice.sycoca: Service type not found: "video/vnd.rn-realvideo"
kf5.kservice.sycoca: Service type not found: "image/x-pic"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.draw"
kf5.kservice.sycoca: Service type not found: "audio/x-pn-realaudio-plugin"
kf5.kservice.sycoca: Service type not found: "application/x-kexi-connectiondata"
kf5.kservice.sycoca: Service type not found: "application/x-mobipocket-ebook"
kf5.kservice.sycoca: Service type not found: "audio/ac3"
kf5.kservice.sycoca: Service type not found: "application/vnd.openofficeorg.extension"
kf5.kservice.sycoca: Service type not found: "image/x-win-bitmap"
kf5.kservice.sycoca: Service type not found: "application/vnd.kde.okular-archive"
kf5.kservice.sycoca: Service type not found: "application/x-zstd-compressed-tar"
kf5.kservice.sycoca: Service type not found: "audio/mpeg"
kf5.kservice.sycoca: Service type not found: "video/mlt-playlist"
kf5.kservice.sycoca: Service type not found: "image/x-kde-raw"
kf5.kservice.sycoca: Service type not found: "application/x-7z-compressed"
kf5.kservice.sycoca: Service type not found: "audio/vnd.rn-realaudio"
kf5.kservice.sycoca: Service type not found: "image/x-panasonic-rw"
kf5.kservice.sycoca: Service type not found: "text/x-patch"
kf5.kservice.sycoca: Service type not found: "application/x-kdenlivetitle"
kf5.kservice.sycoca: Service type not found: "application/vnd.lotus-1-2-3"
kf5.kservice.sycoca: Service type not found: "x-content/blank-cd"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-asf"
kf5.kservice.sycoca: Service type not found: "video/quicktime"
kf5.kservice.sycoca: Service type not found: "image/vnd.djvu"
kf5.kservice.sycoca: Service type not found: "video/x-anim"
kf5.kservice.sycoca: Service type not found: "text/plain"
kf5.kservice.sycoca: Service type not found: "application/x-java-keystore"
kf5.kservice.sycoca: Service type not found: "application/x-archive"
kf5.kservice.sycoca: Service type not found: "application/x-sv4crc"
kf5.kservice.sycoca: Service type not found: "application/vnd.appimage"
kf5.kservice.sycoca: Service type not found: "application/vnd.visio"
kf5.kservice.sycoca: Service type not found: "image/x-tga"
kf5.kservice.sycoca: Service type not found: "application/x-zoom"
kf5.kservice.sycoca: Service type not found: "image/heif"
kf5.kservice.sycoca: Service type not found: "image/rle"
kf5.kservice.sycoca: Service type not found: "text/csv"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-cab-compressed"
kf5.kservice.sycoca: Service type not found: "application/vnd.lotus-wordpro"
kf5.kservice.sycoca: Service type not found: "application/x-xar"
kf5.kservice.sycoca: Service type not found: "audio/aac"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.presentationml.template"
kf5.kservice.sycoca: Service type not found: "image/x-icns"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.presentation"
kf5.kservice.sycoca: Service type not found: "audio/x-tta"
kf5.kservice.sycoca: Service type not found: "application/x-cbt"
kf5.kservice.sycoca: Service type not found: "image/tiff"
kf5.kservice.sycoca: Service type not found: "application/ogg"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-wpl"
kf5.kservice.sycoca: Service type not found: "image/x-pentax-pef"
kf5.kservice.sycoca: Service type not found: "image/x-olympus-orf"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-excel"
kf5.kservice.sycoca: Service type not found: "application/pgp-keys"
kf5.kservice.sycoca: Service type not found: "image/x-jng"
kf5.kservice.sycoca: Service type not found: "application/x-lz4-compressed-tar"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text-master"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.impress.template"
kf5.kservice.sycoca: Service type not found: "application/x-font-pcf"
kf5.kservice.sycoca: Service type not found: "application/xhtml+xml"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text"
kf5.kservice.sycoca: Service type not found: "application/x-java"
kf5.kservice.sycoca: Service type not found: "image/x-sgi"
kf5.kservice.sycoca: Service type not found: "audio/basic"
kf5.kservice.sycoca: Service type not found: "application/x-executable"
kf5.kservice.sycoca: Service type not found: "text/spreadsheet"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.spreadsheet-template"
kf5.kservice.sycoca: Service type not found: "audio/x-ms-wma"
kf5.kservice.sycoca: Service type not found: "image/x-fuji-raf"
kf5.kservice.sycoca: Service type not found: "application/x-compress"
kf5.kservice.sycoca: Service type not found: "audio/vnd.dts"
kf5.kservice.sycoca: Service type not found: "image/fits"
kf5.kservice.sycoca: Service type not found: "application/x-xz"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.formula-template"
kf5.kservice.sycoca: Service type not found: "image/gif"
kf5.kservice.sycoca: Service type not found: "audio/x-ms-asx"
kf5.kservice.sycoca: Service type not found: "video/x-mng"
kf5.kservice.sycoca: Service type not found: "image/x-gimp-gbr"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.chart-template"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
kf5.kservice.sycoca: Service type not found: "application/x-bzpdf"
kf5.kservice.sycoca: Service type not found: "image/png"
kf5.kservice.sycoca: Service type not found: "application/x-gzdvi"
kf5.kservice.sycoca: Service type not found: "application/mxf"
kf5.kservice.sycoca: Service type not found: "application/x-wpg"
kf5.kservice.sycoca: Service type not found: "image/x-xwindowdump"
kf5.kservice.sycoca: Service type not found: "image/x-dcraw"
kf5.kservice.sycoca: Service type not found: "audio/x-mpegurl"
kf5.kservice.sycoca: Service type not found: "x-content/audio-player"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text-web"
kf5.kservice.sycoca: Service type not found: "x-content/blank-dvd"
kf5.kservice.sycoca: Service type not found: "image/cgm"
kf5.kservice.sycoca: Service type not found: "application/x-fictionbook+xml"
kf5.kservice.sycoca: Service type not found: "application/vnd.palm"
kf5.kservice.sycoca: Service type not found: "video/webm"
kf5.kservice.sycoca: Service type not found: "image/wmf"
kf5.kservice.sycoca: Service type not found: "text/tab-separated-values"
kf5.kservice.sycoca: Service type not found: "application/x-pagemaker"
kf5.kservice.sycoca: Service type not found: "application/vnd.comicbook-rar"
kf5.kservice.sycoca: Service type not found: "image/openraster"
kf5.kservice.sycoca: Service type not found: "application/illustrator"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-publisher"
kf5.kservice.sycoca: Service type not found: "application/msword"
kf5.kservice.sycoca: Service type not found: "application/x-krita"
kf5.kservice.sycoca: Service type not found: "application/x-dvi"
kf5.kservice.sycoca: Service type not found: "image/x-portable-bitmap"
kf5.kservice.sycoca: Service type not found: "audio/AMR"
kf5.kservice.sycoca: Service type not found: "application/x-cpio"
kf5.kservice.sycoca: Service type not found: "image/webp"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.writer"
kf5.kservice.sycoca: Service type not found: "text/css"
kf5.kservice.sycoca: Service type not found: "image/x-adobe-dng"
kf5.kservice.sycoca: Service type not found: "image/x-eps"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.draw.template"
kf5.kservice.sycoca: Service type not found: "image/x-compressed-xcf"
kf5.kservice.sycoca: Service type not found: "application/x-bzip-compressed-tar"
kf5.kservice.sycoca: Service type not found: "application/x-quattropro"
kf5.kservice.sycoca: Service type not found: "application/x-ms-dos-executable"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-access"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-powerpoint"
kf5.kservice.sycoca: Service type not found: "application/x-sv4cpio"
kf5.kservice.sycoca: Service type not found: "audio/mp4"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.chart"
kf5.kservice.sycoca: Service type not found: "application/x-lrzip-compressed-tar"
kf5.kservice.sycoca: Service type not found: "application/vnd.comicbook+zip"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.writer.global"
kf5.kservice.sycoca: Service type not found: "application/vnd.apple.mpegurl"
kf5.kservice.sycoca: Service type not found: "application/x-xojpp"
kf5.kservice.sycoca: Service type not found: "application/x-bzdvi"
kf5.kservice.sycoca: Service type not found: "image/x-gimp-pat"
kf5.kservice.sycoca: Service type not found: "image/x-gimp-gih"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.math"
kf5.kservice.sycoca: Service type not found: "image/vnd.zbrush.pcx"
kf5.kservice.sycoca: Service type not found: "video/x-flv"
kf5.kservice.sycoca: Service type not found: "x-content/audio-cdda"
kf5.kservice.sycoca: Service type not found: "image/jpeg"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.calc.template"
kf5.kservice.sycoca: Service type not found: "image/x-sony-arw"
kf5.kservice.sycoca: Service type not found: "image/emf"
kf5.kservice.sycoca: Service type not found: "image/x-sony-srf"
kf5.kservice.sycoca: Service type not found: "image/x-panasonic-rw2"
kf5.kservice.sycoca: Service type not found: "application/prs.plucker"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.graphics-flat-xml"
kf5.kservice.sycoca: Service type not found: "video/dv"
kf5.kservice.sycoca: Service type not found: "application/x-trash"
kf5.kservice.sycoca: Service type not found: "application/pgp-encrypted"
kf5.kservice.sycoca: Service type not found: "image/x-dds"
kf5.kservice.sycoca: Service type not found: "image/x-xcursor"
kf5.kservice.sycoca: Service type not found: "audio/midi"
kf5.kservice.sycoca: Service type not found: "image/x-kodak-dcr"
kf5.kservice.sycoca: Service type not found: "application/vnd.rn-realmedia"
kf5.kservice.sycoca: Service type not found: "application/smil+xml"
kf5.kservice.sycoca: Service type not found: "application/x-font-bdf"
kf5.kservice.sycoca: Service type not found: "application/octet-stream"
kf5.kservice.sycoca: Service type not found: "application/x-k3b"
kf5.kservice.sycoca: Service type not found: "audio/x-it"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
kf5.kservice.sycoca: Service type not found: "application/x-bzpostscript"
kf5.kservice.sycoca: Service type not found: "application/vnd.amazon.mobi8-ebook"
kf5.kservice.sycoca: Service type not found: "application/vnd.rar"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.impress"
kf5.kservice.sycoca: Service type not found: "audio/x-musepack"
kf5.kservice.sycoca: Service type not found: "image/x-sun-raster"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.graphics-template"
kf5.kservice.sycoca: Service type not found: "application/pgp-signature"
kf5.kservice.sycoca: Service type not found: "application/zip"
kf5.kservice.sycoca: Service type not found: "application/x-cd-image"
kf5.kservice.sycoca: Service type not found: "application/x-rpm"
kf5.kservice.sycoca: Service type not found: "application/mathml+xml"
kf5.kservice.sycoca: Service type not found: "image/x-xcf"
kf5.kservice.sycoca: Service type not found: "video/x-nsv"
kf5.kservice.sycoca: Service type not found: "audio/x-scpls"
kf5.kservice.sycoca: Service type not found: "audio/x-speex"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.presentation-flat-xml"
kf5.kservice.sycoca: Service type not found: "application/x-shorten"
kf5.kservice.sycoca: Service type not found: "audio/x-wav"
kf5.kservice.sycoca: Service type not found: "image/x-canon-cr2"
kf5.kservice.sycoca: Service type not found: "application/epub+zip"
kf5.kservice.sycoca: Service type not found: "image/x-photo-cd"
kf5.kservice.sycoca: Service type not found: "audio/x-adpcm"
kf5.kservice.sycoca: Service type not found: "font/ttf"
kf5.kservice.sycoca: Service type not found: "application/vnd.stardivision.writer"
kf5.kservice.sycoca: Service type not found: "image/jp2"
kf5.kservice.sycoca: Service type not found: "x-content/video-svcd"
kf5.kservice.sycoca: Service type not found: "application/javascript"
kf5.kservice.sycoca: Service type not found: "image/bmp"
kf5.kservice.sycoca: Service type not found: "image/x-portable-anymap"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text-master-template"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-htmlhelp"
kf5.kservice.sycoca: Service type not found: "audio/x-gsm"
kf5.kservice.sycoca: Service type not found: "video/mp4"
kf5.kservice.sycoca: Service type not found: "application/sdp"
kf5.kservice.sycoca: Service type not found: "image/x-xbitmap"
kf5.kservice.sycoca: Service type not found: "application/xml"
kf5.kservice.sycoca: Service type not found: "image/x-bzeps"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text-template"
kf5.kservice.sycoca: Service type not found: "video/x-msvideo"
kf5.kservice.sycoca: Service type not found: "application/x-xpinstall"
kf5.kservice.sycoca: Service type not found: "image/svg+xml-compressed"
kf5.kservice.sycoca: Service type not found: "application/x-iwork-keynote-sffkey"
kf5.kservice.sycoca: Service type not found: "application/vnd.debian.binary-package"
kf5.kservice.sycoca: Service type not found: "application/x-matroska"
kf5.kservice.sycoca: Service type not found: "audio/x-s3m"
kf5.kservice.sycoca: Service type not found: "application/x-ksysguard"
kf5.kservice.sycoca: Service type not found: "application/x-keepass2"
kf5.kservice.sycoca: Service type not found: "audio/mp2"
kf5.kservice.sycoca: Service type not found: "image/x-kodak-k25"
kf5.kservice.sycoca: Service type not found: "x-content/blank-hddvd"
kf5.kservice.sycoca: Service type not found: "text/x-google-video-pointer"
kf5.kservice.sycoca: Service type not found: "application/vnd.sun.xml.writer.template"
kf5.kservice.sycoca: Service type not found: "x-content/blank-bd"
kf5.kservice.sycoca: Service type not found: "text/html"
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-works"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.presentationml.slide"
kf5.kservice.sycoca: Service type not found: "audio/x-flac+ogg"
kf5.kservice.sycoca: Service type not found: "application/x-gzpostscript"
kf5.kservice.sycoca: Service type not found: "text/vcard"
kf5.kservice.sycoca: Service type not found: "image/x-sony-sr2"
kf5.kservice.sycoca: Service type not found: "inode/directory"
kf5.kservice.sycoca: Service type not found: "application/x-xopp"
kf5.kservice.sycoca: Service type not found: "application/x-kdenlive"
kf5.kservice.sycoca: Service type not found: "application/vnd.corel-draw"
kf5.kservice.sycoca: Service type not found: "application/vnd.wordperfect"
kf5.kservice.sycoca: Service type not found: "image/x-minolta-mrw"
kf5.kservice.sycoca: Service type not found: "application/vnd.sqlite3"
kf5.kservice.sycoca: Service type not found: "image/x-portable-pixmap"
kf5.kservice.sycoca: Service type not found: "text/vnd.qt.linguist"
kf5.kservice.sycoca: Service type not found: "image/x-canon-crw"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.presentationml.slideshow"
kf5.kservice.sycoca: Service type not found: "x-content/video-dvd"
kf5.kservice.sycoca: Service type not found: "application/vnd.kde.fontspackage"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.wordprocessingml.template"
kf5.kservice.sycoca: Service type not found: "application/oxps"
kf5.kservice.sycoca: Service type not found: "application/x-khtml-adaptor"
kf5.kservice.sycoca: Service type not found: "video/mp2t"
kf5.kservice.sycoca: Service type not found: "application/vnd.adobe.flash.movie"
kf5.kservice.sycoca: Service type not found: "audio/x-mod"
kf5.kservice.sycoca: Service type not found: "image/vnd.rn-realpix"
kf5.kservice.sycoca: Service type not found: "application/postscript"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.spreadsheetml.template"
kf5.kservice.sycoca: Service type not found: "image/vnd.adobe.photoshop"
kf5.kservice.sycoca: Service type not found: "application/x-lzma"
kf5.kservice.sycoca: Service type not found: "audio/AMR-WB"
kf5.kservice.sycoca: Service type not found: "audio/x-aiff"
kf5.kservice.sycoca: Service type not found: "image/x-portable-graymap"
kf5.kservice.sycoca: Service type not found: "text/markdown"
kf5.kservice.sycoca: Service type not found: "application/x-bcpio"
kf5.kservice.sycoca: Service type not found: "application/x-lzip-compressed-tar"
kf5.kservice.sycoca: Service type not found: "video/x-matroska"
kf5.kservice.sycoca: Service type not found: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
kf5.kservice.sycoca: Service type not found: "audio/x-stm"
kf5.kservice.sycoca: Service type not found: "audio/prs.sid"
kf5.kservice.sycoca: Service type not found: "audio/x-ape"
kf5.kservice.sycoca: Service type not found: "application/x-designer"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.graphics"
kf5.kservice.sycoca: Service type not found: "image/vnd.microsoft.icon"
kf5.kservice.sycoca: Service type not found: "text/x-ldif"
kf5.kservice.sycoca: Service type not found: "application/x-kexiproject-shortcut"
kf5.kservice.sycoca: Service type not found: "application/x-font-type1"
kf5.kservice.sycoca: Service type not found: "image/x-exr"
kf5.kservice.sycoca: Service type not found: "image/x-kodak-kdc"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.formula"
kf5.kservice.sycoca: Service type not found: "application/x-cb7"
kf5.kservice.sycoca: Service type not found: "image/x-gzeps"
kf5.kservice.sycoca: Service type not found: "application/x-xopt"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.text-flat-xml"
kf5.kservice.sycoca: Service type not found: "image/x-hdr"
kf5.kservice.sycoca: Service type not found: "multipart/x-mixed-replace"
kf5.kservice.sycoca: Service type not found: "application/x-iso9660-appimage"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.spreadsheet"
kf5.kservice.sycoca: Service type not found: "application/x-java-applet"
kf5.kservice.sycoca: Service type not found: "application/x-sony-bbeb"
kf5.kservice.sycoca: Service type not found: "application/x-kwallet"
kf5.kservice.sycoca: Service type not found: "application/x-tzo"
kf5.kservice.sycoca: Service type not found: "application/vnd.oasis.opendocument.database"
kf5.kservice.sycoca: Service type not found: "video/vnd.mpegurl"
kf5.kservice.sycoca: Service type not found: "application/x-dbf"
kf5.kservice.sycoca: Service type not found: "application/x-hwp"
kf5.kservice.sycoca: Service type not found: "application/x-navi-animation"
kf5.kservice.sycoca: Service type not found: "application/x-font-afm"
kf5.kservice.sycoca: Service type not found: "audio/x-opus+ogg"
kf5.kservice.sycoca: Service type not found: "application/ram"
kf5.kservice.sycoca: Service type not found: "multipart/mixed"
kf5.kservice.sycoca: Service type not found: "image/fax-g3"
...
Jan 31 17:24:18 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:24:18 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:24:18 laptop systemsettings5[20318]: Entry "application/vnd.ms-publisher" is dirty. Saving.
Jan 31 17:21:57 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:21:57 laptop systemsettings5[20318]: kf5.kservice.services: KMimeTypeTrader: mimeType "application/vnd.ms-publisher" not found
Jan 31 17:21:57 laptop systemsettings5[20318]: "application/vnd.ms-publisher" hasDefinitionFile: false
上面的一些值得注意的消息包括:
kf5.kservice.sycoca: Service type not found: "application/vnd.ms-publisher"
kf5.kservice.sycoca: Service type not found: "application/illustrator"
我已经证明了 mime 类型application/vnd.ms-publisher
是存在和定义的。所以我随机检查了几个。这是application/illustrator
(删除评论以节省空间)。
less /usr/share/mime/application/illustrator.xml
<?xml version="1.0" encoding="utf-8"?>
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/illustrator">
<!--Created automatically by update-mime-database. DO NOT EDIT!-->
<generic-icon name="image-x-generic"/>
<glob pattern="*.ai"/>
<alias type="application/vnd.adobe.illustrator"/>
</mime-type>
All the mime-type definitions seems to be present according to a listing of ls /usr/share/mime/application/
(There is not sufficient space to post the entire directory listing here.)
I do not understand why the log messages indicate "Service type not found" for mime-types that are present on my system. But more importantly, why can I not add an application to handle the mime type as shown above?
Response to comments by Nathaniel M. Beaver
$ ktraderclient5 --mimetype application/vnd.ms-publisher
mimetype is : application/vnd.ms-publisher
got 1 offers.
---- Offer 0 ----
Invalid property Actions
StartupNotify : 'TRUE'
StartupWMClass : 'libreoffice-draw'
Invalid property UntranslatedGenericName
Invalid property X-GIO-NoFuse
X-KDE-Protocols : 'file - http - ftp - webdav - webdavs'
Type : 'Application'
Name : 'LibreOffice Draw'
Comment : 'Create and edit drawings, flow charts, and logos by using Draw.'
GenericName : 'Drawing Program'
Icon : 'libreoffice-draw'
Exec : 'libreoffice --draw %U'
Terminal : 'FALSE'
Invalid property TerminalOptions
Invalid property Path
ServiceTypes : 'application/vnd.oasis.opendocument.graphics - application/vnd.oasis.opendocument.graphics-flat-xml - application/vnd.oasis.opendocument.graphics-template - application/vnd.sun.xml.draw - application/vnd.sun.xml.draw.template - application/vnd.visio - application/x-wpg - application/vnd.corel-draw - application/vnd.ms-publisher - image/x-freehand - application/clarisworks - application/x-pagemaker - application/pdf - application/x-stardraw - image/x-emf - image/x-wmf - Application'
AllowAsDefault : 'TRUE'
InitialPreference : '5'
Invalid property Library
DesktopEntryPath : '/usr/share/applications/libreoffice-draw.desktop'
DesktopEntryName : 'libreoffice-draw'
Keywords : 'Vector - Schema - Diagram - Layout - OpenDocument Graphics - Microsoft Publisher - Microsoft Visio - Corel Draw - cdr - odg - svg - pdf - vsd'
FormFactors : ''
Categories : 'Office - FlowChart - Graphics - 2DGraphics - VectorGraphics - X-Red-Hat-Base - X-MandrivaLinux-Office-Drawing'
What is the recommended way to remove this?
Here's a step-by-step approach to debugging mimetype association problems.
Determine the file's mimetype.
Determine the default handler for the mimetype.
Add the
XDG_UTILS_DEBUG_LEVEL=2
environment variable for more information.Use
xdg-mime
to change the default association.This can also be done with graphical programs such as Dolphin. The result is not always the same, as we shall see.
Check to see if that changed the default handler.
If
xdg-mime
was successful, it will look like this:If it didn't work, you'll see this again.
If
xdg-mime
didn't work, it's debugging time. Check this file first:~/.config/mimeapps.list
It has these sections:
[Added Associations]
,[Default Applications]
, and[Removed Associations]
.Let's just quickly
grep
to see what's going on.Hm, that doesn't look right. If we inspect the file further, we see that
xdg-mime
added kate under[Default Applications]
but not[Added Associations]
. If we had changed the mimetype using Dolphin /keditfiletype5 application/vnd.ms-publisher
, we would have observed that it would have addedorg.kde.kate.desktop;
beforelibreoffice-writer.desktop;
under[Added Associations]
.https://cgit.kde.org/kde-cli-tools.git/tree/keditfiletype/mimetypedata.cpp?id=5d1c3d77798949c21958b60cf78d36fb49c57ea2#n367
Going by the FreeDesktop spec, though, it shouldn't matter; anything under
[Default Applications]
should be the default even if it's not listed in[Added Associations]
.So this is probably a bug in KDE, and it appears to be fixed upstream here:
https://phabricator.kde.org/D26690
This is probably also a bug in
xdg-mime
, which is a giant shell script that doesn't get enough attention as it needs to do a tip-top job.Anyways, let's fix that line so it says this instead:
Let's see if that helped.
Hm, why didn't that work?
It's because
xdg-mime
doesn't check things on its own, it calls whatever tools the desktop uses. On KDE, this is things likekmimetypefinder5
,ktraderclient5
, andkbuildsycoca5
. That last one is important, because it's how KDE builds its mimetype associations cache.Note this is not the cache at
~/.local/share/applications/mimeinfo.cache
, although that is also a mimetype cache, because that location is listed as "for compatibility, deprecated" in the latest spec.The proper way would be to rebuild KDE's mimetype is this:
but we can also just delete it instead:
and try again:
That looks promising. Now let's try opening an actual file:
On KDE, this is basically the same as:
This should open in the Kate text editor. Success!
What if it still doesn't work?
On KDE Plasma 5,
xdg-mime query default
just callsktraderclient5 --mimetype
. Soktraderclient5 --mimetype application/vnd.ms-publisher
will provide helpful information, although the output may be voluminous.Adding
XDG_UTILS_DEBUG_LEVEL=2
to thexdg-*
commands may give some better debug output.Enabling logging on KDE to get
qDebug
output may help, too.Also, check what file your application is using.
xdg-open
useskde-open5
, but your application may behave differently. For example, it might be looking at an old, deprecation mimetype associations file location:~/.local/share/applications/mimeapps.list
or maybe an even older location:
~/.local/share/applications/defaults.list
You might have to dig through source code or use
strace
to figure out which file the application is actually using.If you're using custom mimetypes or custom desktop files, the situation becomes even more complicated.
在完全不同的系统上也一样。以普通用户的身份执行此操作:
(
mkdir
如果目录已经存在,则可能不需要该步骤)。如果您需要完全重置,请执行以下操作:
这将重置所有已损坏的 mime 设置,但它会继续工作。目前 KDE 在进行更改后不会调用更新数据库,从而导致此问题。
This could either be a bug or due to your files being corrupted. My vote would go for corruption.
To be sure, please, try the same procedure in a fresh system and report back if it works.
Then, if you are convinced it's a corruption, try
which would check installed packages and report the files corrupted or changed.
paccheck
is part of the pacutils package. It is discussed on the Arch Wiki.