Sunday, November 18, 2007

Ubuntu: msttcorefonts problem fixed

This is just for my own note as I have problem when installing msttcorefonts on Ubuntu Linux but anyway it is fixed, the problem is due to the wrong setting in the proxy where you can find under System -> Preferences -> Network Proxy. If you encounter the similar problem when installing other stuffs, this post may give a hint of how to fix it as well. I have been lazy to post this up but anyway here you got it -

I have encountered the problem below when installing msttcorefonts and I have tried various ways to fix(e.g. remove or fix with dpkg tool)but no luck, here's the error I got when I was trying to apt-get remove --purge msttcorefonts

Blablabla .....
dpkg: error processing msttcorefonts (--purge):
subprocess pre-removal script returned error exit status 1

These fonts were provided by Microsoft "in the interest of cross-
platform compatibility". This is no longer the case, but they are
still available from third parties.

You are free to download these fonts and use them for your own use,
but you may not redistribute them in modified form, including changes
to the file name or packaging format.

Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
Error parsing proxy URL http://:8080/: Invalid host name.
andale32.exe: No such file or directory

All done, errors in processing 1 file(s)
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
msttcorefonts
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to search the ubuntu forum but no luck, and finally I figured I can fix by commenting these two lines in /var/lib/dpkg/info/msttcorefonts.postinst -

# db_get msttcorefonts/http_proxy
# http_proxy=$RET

Now I can do

shell>sudo apt-get remove --purge msttcorefonts

Problem fixed. Now you need to get the setting of your proxy right or just remove it to use direct connection and reinstall msttcorefonts.

Cheers ;]

16 comments:

Anonymous said...

Brilliant! Thanks!

Unknown said...

Wow, thanks a lot for your great solution. I had the exact same problem and your solution works. I just had to do one extra step: after editing the postinst config file, I had to fully install msttcorefonts using aptitude. Only after installing it and configuring it correctly, was I able to fully uninstall it again (+ purging after that)

Bye and thanks again,

Mark

Pete said...

Neat... finally I can lay that one to rest... your method was awesome.. the only cahnge i did was to apply "dpkg --reconfigure -a" instead of the purge.

Anonymous said...

Finally! Thank you so much, I have had so many problems because of this annoying bug.

Can finally get on with it :)

Anonymous said...

Thanks! This had been bugging me for ages.

Anonymous said...

Thanks a lot, I searched a lot for the solution.

Anonymous said...

Thanks alot - seems to be a problem for users in the latest Ubuntu builds. Maybe msttcorefonts shouldn't be in the default install at all.

H. S. Quint said...

Good Tip, but since I am new at Ubuntu I do not know how to edit this Script. I can open and change the settings as you explained, but I cannot save.

Brito said...

You need to type the mentioned command as administrator.

Type:
sudo gedit /var/lib/dpkg/info/msttcorefonts.postinst

Anonymous said...

Im really new with this stuff so what do you mean by "fix by commenting these two lines"? Commenting? How should i comment the lines?

Anonymous said...

Thanks man!

Unknown said...

Great! Thanks a lot!

Rob said...

Almost 2 years since your post and still helpful. Thanks for posting this.

Jeffrey said...

Thank you very much!!! It was very helpful

Patrick H. said...

Thanks!

Eduardo said...

Thanks!!!!