我正在运行 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 系统设置 > 应用程序 > 文件关联创建了它。
此屏幕截图显示了我所做的事情。当我单击“应用”时,会短暂显示进度对话框,操作似乎已成功。
然而,在重新访问同一对话框时,我刚刚添加的凯特关联消失了。“应用程序优先顺序”下的框为空。
我的问题是:是什么导致此文件关联无法保存,如何修复它?
检查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>
所有 mime 类型定义似乎都根据以下列表存在ls /usr/share/mime/application/
(此处没有足够的空间来发布整个目录列表。)
我不明白为什么日志消息对于我的系统上存在的 mime 类型显示“未找到服务类型”。但更重要的是,为什么我不能添加一个应用程序来处理上面所示的 mime 类型?
对 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'
建议的删除方法是什么?
答案1
在完全不同的系统上也是如此。以普通用户身份执行此操作:
mkdir -p $HOME/.local/share/mime/packages
update-mime-database $HOME/.local/share/mime
(mkdir
如果目录已经存在,则可能不需要此步骤)。
如果您需要完全重置,请执行以下操作:
cd $HOME/.local/share/
mv mime mime2
mkdir -p mime/packages
update-mime-database $HOME/.local/share/mime
这将重置所有 mime 损坏的设置,但它会继续工作。目前 KDE 在进行更改后不会调用更新数据库,从而导致此问题。
答案2
以下是调试 mimetype 关联问题的分步方法。
确定文件的 mime 类型。
$ xdg-mime query filetype ~/.ssh/id_rsa.pub application/vnd.ms-publisher
确定 mimetype 的默认处理程序。
$ xdg-mime query default application/vnd.ms-publisher libreoffice-writer.desktop
添加
XDG_UTILS_DEBUG_LEVEL=2
环境变量以获取更多信息。$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/vnd.ms-publisher Running KDE trader query "application/vnd.ms-publisher" mimetype and "Application" servicetype libreoffice-writer.desktop
用于
xdg-mime
更改默认关联。$ XDG_UTILS_DEBUG_LEVEL=2 xdg-mime default org.kde.kate.desktop application/vnd.ms-publisher make_default_kde: No kde runtime detected make_default_generic org.kde.kate.desktop application/vnd.ms-publisher Updating /home/nathaniel/.config/mimeapps.list
这也可以通过图形程序(例如 Dolphin)来完成。正如我们将看到的,结果并不总是相同的。
检查是否更改了默认处理程序。
如果
xdg-mime
成功的话,它将如下所示:$ xdg-mime query default application/vnd.ms-publisher org.kde.kate.desktop
如果它不起作用,你会再次看到这个。
$ xdg-mime query default application/vnd.ms-publisher libreoffice-writer.desktop
如果
xdg-mime
不起作用,就到了调试时间。首先检查这个文件:~/.config/mimeapps.list
它有以下部分:
[Added Associations]
、[Default Applications]
和[Removed Associations]
。让我们快速
grep
看看发生了什么。$ grep 'application/vnd.ms-publisher' ~/.config/mimeapps.list application/vnd.ms-publisher=libreoffice-writer.desktop;libreoffice-draw.desktop; application/vnd.ms-publisher=org.kde.kate.desktop;
嗯,这看起来不对。如果我们进一步检查该文件,我们会看到
xdg-mime
在 下添加了 kate,[Default Applications]
但没有添加[Added Associations]
。如果我们使用 Dolphin / 更改 mimetypekeditfiletype5 application/vnd.ms-publisher
,我们会观察到它会org.kde.kate.desktop;
在之前添加到libreoffice-writer.desktop;
下[Added Associations]
。正经过免费桌面规格不过,这应该不重要;
[Default Applications]
即使未在 中列出,下面的任何内容都应该是默认值[Added Associations]
。[默认应用程序] 组指示用于给定 mimetype 的默认应用程序。例如,双击文件管理器中的文件时将启动该程序。如果不再安装该应用程序,则会尝试列表中的下一个应用程序,依此类推。
所以这可能是 KDE 中的一个错误,并且它似乎已在上游修复:
将 mimeapps.list 中的“默认应用程序”设置为首选应用程序
https://phabricator.kde.org/D26690
这是可能也是一个错误中
xdg-mime
,其中是一个巨大的shell脚本这并没有得到足够的重视,因为它需要做好出色的工作。无论如何,让我们修复该行,使其改为:
application/vnd.ms-publisher=org.kde.kate.desktop;libreoffice-writer.desktop;libreoffice-draw.desktop;
让我们看看这是否有帮助。
$ xdg-mime query default application/vnd.ms-publisher libreoffice-writer.desktop
嗯,为什么没用?
这是因为
xdg-mime
它不会自行检查,而是调用桌面使用的任何工具。在 KDE 上,它是诸如kmimetypefinder5
、ktraderclient5
、 和 之类的东西kbuildsycoca5
。最后一项很重要,因为这是 KDE 构建其 mimetype 关联缓存的方式。请注意,这不是位于 的缓存
~/.local/share/applications/mimeinfo.cache
,尽管这也是一个 mimetype 缓存,因为该位置被列为最新规范中的“出于兼容性考虑,已弃用”。正确的方法是重建 KDE 的 mimetype,如下所示:
$ kbuildsycoca5
但我们也可以直接删除它:
$ rm ~/.cache/ksycoca5_*
然后再试一次:
$ xdg-mime query default application/vnd.ms-publisher org.kde.kate.desktop
这看起来很有希望。现在让我们尝试打开一个实际的文件:
$ xdg-open ~/.ssh/id_rsa.pub
在 KDE 上,这是基本上与:
$ kde-open5 ~/.ssh/id_rsa.pub
这应该在 Kate 文本编辑器中打开。成功!
如果还是不行怎么办?
在 KDE Plasma 5 上,
xdg-mime query default
只需调用ktraderclient5 --mimetype
.因此ktraderclient5 --mimetype application/vnd.ms-publisher
将提供有用的信息,尽管输出可能会很大。添加
XDG_UTILS_DEBUG_LEVEL=2
到xdg-*
命令可能会提供更好的调试输出。在 KDE 上启用日志记录以获取
qDebug
输出也可能有所帮助。$ if ! test -f ~/.config/QtProject/qtlogging.ini; then printf '[Rules]\n*.debug=true\nqt.*.debug=false\n' > ~/.config/QtProject/qtlogging.ini; else printf 'Error: ~/.config/QtProject/qtlogging.ini already exists.\n'; fi;
另外,检查您的应用程序正在使用什么文件。
xdg-open
使用kde-open5
,但您的应用程序的行为可能有所不同。例如,它可能正在查看旧的、已弃用的 mimetype 关联文件位置:~/.local/share/applications/mimeapps.list
或者可能是更旧的位置:
~/.local/share/applications/defaults.list
您可能必须深入研究源代码或使用它
strace
来找出应用程序实际使用的文件。如果您使用自定义 mimetypes 或自定义桌面文件,情况会变得更加复杂。