mime-types are hosed; can I fix them?

Asked by teledyn

Binary package hint: nautilus

I don't know how it got this way, but ALMOST all of the mime-types displaying in Nautilus are wrong, listing video and mp3 files as text files and only offering text editors as 'players' -- I don't want to clear this user account and re-install (ie the Windows approach) but I can't find any obvious user-space file that would explain this behaviour! Where does Nautilus get its mime-type information? Is there some way to restore defaults? If I knew the files, perhaps I could copy them over from another account.

ProblemType: Bug
Architecture: i386
Date: Fri Aug 21 08:26:12 2009
DistroRelease: Ubuntu 8.04
ExecutablePath: /usr/bin/nautilus
NonfreeKernelModules: wl fglrx
Package: nautilus 1:2.22.5.1-0ubuntu3
PackageArchitecture: i386
ProcEnviron:
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
Uname: Linux 2.6.24-24-rt i686

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nautilus Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
Last query:
Last reply:

This question was originally filed as bug #416916.

Revision history for this message
teledyn (garym-teledyn) said :
#1
Revision history for this message
Pedro Villavicencio (pedro) said :
#2

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We appreciate the difficulties you are facing, but it would make more sense to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs#When%20not%20to%20file%20a%20bug.

Revision history for this message
teledyn (garym-teledyn) said :
#3

a further clue: I load a PDF file in a scribd viewer page, and then save that page to the disk; if I then try the command line

evince /home/garym/Desktop/18958675-Miscellaneous-Patterns.pdf

evince shows an error page: Unable to open document - Unhandled MIME type: “application/octet-stream”

and yet ...

$ file 18958675-Miscellaneous-Patterns.pdf
18958675-Miscellaneous-Patterns.pdf: PDF document, version 1.3

Revision history for this message
Sam_ (and-sam) said :
#4
Revision history for this message
teledyn (garym-teledyn) said :
#5

I found the line and removed it; no effect on this problem. the second
link suggests modifying the line to include nautilus so I used their example
setting, still no effect.

it is perhaps worthwhile to repeat that *not all mime-types are affected.*
It appears to only affect some files, and while some old files are affected,
such as .desktop, mp3 and avi files, I notice that while desktop PDF icons
remain as previews, any new PDF files are give the default icon for text
(which then shows the ascii view of the pdf header)

with or without the inode/directory line has the same behaviour;
mimeapps.list now reads:

[Added Associations]
inode/directory=nautilus-folder-handler.desktop;nautilus.desktop;
video/mp4=userapp-xine-NL51JU.desktop;mplayer.desktop;mplayer-usercreated.desktop;
video/x-msvideo=mplayer-usercreated.desktop;userapp-gmplayer-A2UYGU.desktop;
application/x-flash-video=vlc.desktop;userapp-gmplayer-A2UYGU.desktop;userapp-xine-RBHMHU.desktop;
image/jpeg=userapp-qiv-HPNCLU.desktop;gedit.desktop;
video/x-ms-wmv=userapp-gmplayer-TF5HPU.desktop;userapp-xine-NL51JU.desktop;
application/x-palm-database=userapp-plucker-J0MCOU.desktop;
application/vnd.rn-realmedia=userapp-gmplayer-A2UYGU.desktop;
application/msword=ooo-writer.desktop;userapp-gedit-TWR8UU.desktop;
application/x-extension-bin=userapp-bash-T6N2UU.desktop;
text/plain=userapp-qiv-HPNCLU.desktop;userapp-audacity-GDSMYU.desktop;

[Removed Associations]
video/x-msvideo=userapp-mplayer-9XK2GU.desktop;mplayer.desktop;
video/mp4=mplayer-usercustom.desktop;userapp-gmplayer-ERVOIU.desktop;userapp-mplayer-MI5KIU.desktop;

On Sat, Aug 22, 2009 at 4:42 PM, Sam <email address hidden>wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> Reference:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/77488
> https://answers.launchpad.net/ubuntu/+question/46377
>
> https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/260492
> https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/366963
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599/+confirm?answer_id=3
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Sam_ (and-sam) said :
#6

Not really a clue what's wrong, mimeapps.list looks ok to me though.

The output of:
cat .local/share/applications/evince.desktop | less

shows something like this?
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-dvi;image/vnd.djvu;image/tiff;application/x-cbr;application/x-cbz;application/vnd.sun.xml.impress;application/vnd.oasis.opendocument.presentation;

The output of:
gconftool --get /apps/gnome-app-install/mime-whitelist-components
is
[main]

In case to make a reset of e.g. Nautilus config:
gconftool-2 --recursive-unset /apps/nautilus

see also:
man gconftool

btw. a reinstallation isn't necessary
in case just reinstall e.g. Nautilus, evince or ubuntu-desktop

Update of icon cache:
sudo gtk-update-icon-cache -f /usr/share/icons/default
sudo gtk-update-icon-cache -f /usr/share/icons/gnome
sudo gtk-update-icon-cache -f /usr/share/icons/Human

sudo updatedb

Revision history for this message
Sam_ (and-sam) said :
#7
Revision history for this message
teledyn (garym-teledyn) said :
#8

I didn't think these system-level things would change anything because this
is peculiar to one user account, and sure enough, I did all of the above
with /usr/lib/mime, removed mime.cache, recursive unset and all the
gtk-update-icon-cache commands and forced out nautilus and reinstalled
desktop-base and nautilus and still there is no change :(

the icons are generic textfile and the only app provided in the menu are
text editors or those apps I have manually specified in desperation to get
it going.

On Sat, Aug 22, 2009 at 7:12 PM, Sam <email address hidden>wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> Sam proposed the following answer:
> Or as suggested here
> https://bugs.launchpad.net/evince/+bug/163764
>
> remove or rename
> ~/.local/share/mime/mime.cache
>
> Other ideas
>
> http://www.linuxquestions.org/questions/linux-software-2/unhandled-mime-type-applicationoctet-stream-651502/?s=aa532cbf8f05ef5d27b0018d1b86eeb6
> http://linux.derkeiler.com/Mailing-Lists/Debian/2007-08/msg02841.html
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599/+confirm?answer_id=6
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
teledyn (garym-teledyn) said :
#9

let me retract that: I created a new gnome-desktop account and all of those
mimetypes were text/plain too!! So it isn't a user-space issue, it is a
system-space issue. Also, even those objects displayed with the correct PDF
icon still rate only text/plain apps when I right click on them.

On Sat, Aug 22, 2009 at 8:39 PM, teledyn <
<email address hidden>> wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> Status: Answered => Open
>
> You are still having a problem:
> I didn't think these system-level things would change anything because this
> is peculiar to one user account, and sure enough, I did all of the above
> with /usr/lib/mime, removed mime.cache, recursive unset and all the
> gtk-update-icon-cache commands and forced out nautilus and reinstalled
> desktop-base and nautilus and still there is no change :(
>
> the icons are generic textfile and the only app provided in the menu are
> text editors or those apps I have manually specified in desperation to get
> it going.
>
> On Sat, Aug 22, 2009 at 7:12 PM, Sam
> <email address hidden>wrote:
>
> > Your question #80599 on nautilus in ubuntu changed:
> > https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
> >
> > Sam proposed the following answer:
> > Or as suggested here
> > https://bugs.launchpad.net/evince/+bug/163764
> >
> > remove or rename
> > ~/.local/share/mime/mime.cache
> >
> > Other ideas
> >
> >
> http://www.linuxquestions.org/questions/linux-software-2/unhandled-mime-type-applicationoctet-stream-651502/?s=aa532cbf8f05ef5d27b0018d1b86eeb6
> > http://linux.derkeiler.com/Mailing-Lists/Debian/2007-08/msg02841.html
> >
> > --
> > If this answers your question, please go to the following page to let us
> > know that it is solved:
> >
> >
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599/+confirm?answer_id=6
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
> >
> > You received this question notification because you are a direct
> > subscriber of the question.
> >
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Sam_ (and-sam) said :
#10

Integrity?
/etc/mime.types
unchanged here since 4/2008 has 750 lines.

Revision history for this message
teledyn (garym-teledyn) said :
#11

SOLVED: /usr/local/share/mime/magic was corrupted -- copied it from another
(ancient mandriva) machine, removed the mime.cache files, restarted my
session and VOILA!! actual document icons with actual Open menus!!

I am so happy :)

Thanks for all your help. I haven't a clue how the magic file got
clobbered, I think it may have been an experimental build of Rosegarden, but
whatever, that is now yet another mystery solved that I shall likely never
need to know ever again ;)

On Sat, Aug 22, 2009 at 8:59 PM, Sam <email address hidden>wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> Status: Open => Answered
>
> Sam proposed the following answer:
> Integrity?
> /etc/mime.types
> unchanged here since 4/2008 has 750 lines.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599/+confirm?answer_id=9
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Best Sam_ (and-sam) said :
#12

Well done, and thanks for posting your solution, it might help others.

Revision history for this message
teledyn (garym-teledyn) said :
#13

sure was a strange one; I'm so glad it's over too ;)

Revision history for this message
teledyn (garym-teledyn) said :
#14

alas, I spoke too soon, seems it only solved desktop icons, nautilus is
still very broken, and on top of it, it appears that magic file I snarfed
from Mandriva does not occur in the Ubuntu package contents listings! I
think it is on the right track, but it is not a solution :(

On Sun, Aug 23, 2009 at 4:45 PM, teledyn <
<email address hidden>> wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> Status: Answered => Solved
>
> You confirmed that the question is solved:
> sure was a strange one; I'm so glad it's over too ;)
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
teledyn (garym-teledyn) said :
#15

sudo dpkg -r --force-depends file
sudo aptitude install file

and removed mime.cache, now nautilus appears to work; I had also removed and
reinstalled shared-mime-info, gnome-mime-data, mime-support but those had no
apparent effect, at least not until I reinstalled 'file'

On Sun, Aug 23, 2009 at 11:09 PM, teledyn <
<email address hidden>> wrote:

> Your question #80599 on nautilus in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
>
> teledyn posted a new comment:
> alas, I spoke too soon, seems it only solved desktop icons, nautilus is
> still very broken, and on top of it, it appears that magic file I snarfed
> from Mandriva does not occur in the Ubuntu package contents listings! I
> think it is on the right track, but it is not a solution :(
>
> On Sun, Aug 23, 2009 at 4:45 PM, teledyn <
> <email address hidden>> wrote:
>
> > Your question #80599 on nautilus in ubuntu changed:
> > https://answers.launchpad.net/ubuntu/+source/nautilus/+question/80599
> >
> > Status: Answered => Solved
> >
> > You confirmed that the question is solved:
> > sure was a strange one; I'm so glad it's over too ;)
> >
> > --
> > You received this question notification because you are a direct
> > subscriber of the question.
> >
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
teledyn (garym-teledyn) said :
#16

just happened again, this time all mp3's were listed as "MP3 Documents" and given the page icon with the mime-type x-extension-mp3

the fix was to delete ~/.local/share/mime/mime.cache