Wednesday, February 6, 2013

INSTALL MICROSOFT OFFICE 2010 IN UBUNTU 14.04/13.10/13.04/12.10 AND MINT AND MAKE IT DEFAULT


Microsoft Office is my favorite office application. The default LibreOffice in Ubuntu 12.10 lacks a lot of Features available in MS Office. After succesfull installation of Microsoft Office 2007 in Ubuntu 11.10 and 12.04/12.10, I tried installing Microsoft Office 2010 in 12.10. The installation instructions for Microsoft Office 2007 in 12.10 is same as that in 12.04. To install Microsoft Office 2010 in Ubuntu 12.10,  I followed the following steps. There are few changes in the dependencies needed for 2010 when compared to 2007. This method works in Ubuntu 13.04, 13.10 and 14.04 as well. This has been tested on both 32 and 64 bits successfully. This method is reported to work in Ubuntu derivatives like Mint by users through comment.

1. For 64-bit users first step is to install mesa OpenGL and the 32-bit libraries. For all except 14.04 :

 

For Ubuntu 14.04 users the ia32-libs is replaced by lib32z1

 

For 32 bit users first step is to install mesa OpenGL only and move to step 3 skipping step 2:

 


2. 64 bit users need to create softlinks for the 32-bit OpenGL libraries. 32-bit users can skip this step


 

3. Install wine1.5 or above from the Official Wine PPA.

 

4. 64 bit users only must run the following commands in a terminal. This will set the Windows version as 32 bit. The Microsoft Office is available for 32 bit only. This is important since only Microsoft Office 2010 32-bit works on Wine and you need a 32-bit Wine environment to run 32-bit Windows applications. This time we are creating a new WINEPREFIX instead of changing the wine settings globally as it might cause problem with other applications installed under wine. The WINEPREFIX can be any directory of your choice.


 


32 bit users can set the WINEPREFIX. WINEARCH is not needed for 32 bit users.


5. In winetricks install the following dll components: vcrun2008, dotnet20, dotnet40, msxml6, riched20, riched30, gdiplus, vb2run (not mandatory), vb3run, vb4run, vb5run, vb6run, ie8. Also install corefonts from fonts in winetricks. Some components needs to be downloaded manually for this purpose. Download these and paste in ./cache/winetricks/ under home. You can download all the dependencies from this link and extract to ./cache/winetricks in home. The .cache directory is hidden and can be unhided by pressing Ctrl+H. After extracting you can run the single command to install all these in terminal.

 

Alternatively select the packages from graphical interface. Run winetricks in terminal and following screen appears. Select Install a Windows DLL or Component and Press Ok.
ms office ubuntu

Tick the following packages: vcrun2008, dotnet20, dotnet40, msxml6, riched20, riched30, gdiplus, vb2run, vb3run, vb4run, vb5run, vb6run, ie8.
[Some components needs to be downloaded manually for this purpose. Download these and paste in ./cache/winetricks/ under home. You can download all the dependencies from this link and extract to ./cache/winetricks in home. The .cache directory is hidden and can be unhided by pressing Ctrl+H.]



6. Now run winecfg in terminal. In the wine settings window that appears go to "Libraries" tab. From the "Existing overrides" section, select the above installed dll components and click Edit and change from"(native, built-in)" to "Native (Windows)" and click OK.

ms office ubuntu

7. The dependencies needed for Microsoft Office 2010 are installed and now we can install Microsoft office. Copy the installer to home and cd to that folder. Now run "wine Setup.exe". Replace setup.exe with filename or path of Installer. Now follow the Installer and complete the setup. The office can be run from Dash by searching Microsoft.


Note: If you close the  terminal in between installation the default wineprefix might change in that case installation can be done by using the following command instead:
WINEPREFIX=/home/user/.wineprefixes/office2010/ wine Setup.exe



ms office ubuntums office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu

ms office ubuntu



8. The microsoft office applications can be made default by adding the following lines to  ~/.local/share/applications/mimeaaps.list.
This must be added under both [Default Applications] as well as [Added Associations] section

 

Note : 1. By installing cups-pdf (sudo apt-get install cups-pdf), we can have a pdf printer in wine. This way, we can export to PDF not only from MS Office, but also from any other application installed in wine.
                 2. VBA macros need microsoft visual basic runtimes which is available for installation via winetricks as vb2run, vb3run, vb4run, vb5run, vb6run, etc. Install these as in Step 5 if they are required.

41 comments:

  1. can i just install this only, i dont want to install microsoft office 2007. i want directly want to install this only ?

    ReplyDelete
    Replies
    1. You can install this only. The links I have provided was just for people who want to install 2007. Installing one is enough. But many people might have bought 2007 and they have license only for that. If you have 2010 installer you can install it following these steps.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. very useful tutorial, your are ubuntu guru :)

    ReplyDelete
  4. At point 5 I get confused. How do I install the dll components and nust I create a folder named Wine in the cache folder or should it be already there. Could someone please explain it to me. i would be very great full.

    ReplyDelete
    Replies
    1. In step 5 you can download the file provided from the link and extract in .cache. The extracted files will be in a new folder winetricks. You dont have to create any new folder.

      https://docs.google.com/file/d/0B-2NFb_3ZVMWN1psRnJwSzZKLWs/edit?usp=sharing

      Delete
  5. You're amazing! Magnifico! After two weeks of running libre4.0/Office 2003 for compatibility with work, second guessing myself and hanging my head in shame, I can now confidently tell co-workers my .pptx and .docx are 100% legit!!!

    ReplyDelete
  6. I follow every step, but when I do "wine setup.exe", all I see is errors:
    err:module:import_dll Library mscoree.dll (which is needed by L"C:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorsvw.exe") not found

    I don't know how to fix that!

    ReplyDelete
    Replies
    1. Please try running the following command with correct path to installer inplace of setup.exe and your username instead of user. Please post the error if u get any by running this here as reply.

      WINEPREFIX=/home/user/.wineprefixes/office2010/ wine setup.exe

      Delete
  7. Doesn't work! :( Says I am not the owner of files. But I installed the "playonlinux" and installation went ok!

    ReplyDelete
    Replies
    1. ok... Its working perfectly with playonlinux? It also uses wine as the engine

      Delete
  8. i followed all the steps... but i can´t install "dotnet40" send me an error "The windows error" "Send" "dont send".
    Can you provide me how fix this issue.

    PD: Sorry with my english, its not my native lenguaje.

    Best regards!!!

    ReplyDelete
    Replies
    1. Please download Microsoft Installer 3 and install it in the same WINEPREFIX. Then try again with dotnet40.

      Delete
  9. Thanks for your help, i will try, and i'll let you know. by the way i'm using Ubuntu 32 bits, i don´t know if a need to create the WINEPREFIX.

    Best regards!!!

    ReplyDelete
    Replies
    1. Creating WINEPREFIX is not mandatory. It is recommended because it will separate the different programs installed under wine. If you are making a separate WINEPREFIX please make sure that the dependencies installed in Step 5 are also in same WINEPREFIX.

      Delete
    2. Thanks a lot Nithin. I created the .wineprefixes/office2010 and everthing it work successfully.
      dotnet40 don´t send me any error; and MSOFFICE 2010 working as you say.

      Delete
  10. Thanks Nithin!! It works. Good Work keep it up :)

    ReplyDelete
    Replies
    1. Thanks you. Really happy to find that it works for others also without any trouble :)

      Delete
  11. Thank you very much. It works fine for me. Really appreciate you effort to share this tutorial.

    From Malaysia

    ReplyDelete
    Replies
    1. Thank you. Really happy to find that it works for others also without any trouble :)

      Delete
  12. Hi Nitinn,
    firstly thanks for the tutorial, but i am getting the below error

    wine: cannot find L"C:\\windows\\system32\\Setup.exe"

    Any help would be appreciated.

    ReplyDelete
    Replies
    1. WINEPREFIX=/home/user/.wineprefixes/office2010/ wine Setup.exe

      In this command replace user with your username and Setup.exe with path and name of your setup file. You need to have the MSOffice Installers path instead of Setup.exe in the command.

      Delete
  13. It's working without any problem. Thanks for your help.

    ReplyDelete
  14. I have installed wine-1.6.rc2 in my ubuntu 12.04 LTS.
    But it is not working.
    When I give "winetricks" cmd.,
    I get the following : wine cmd.exe /c echo '%ProgramFiles%' returned empty string

    Could you kindly guide me?

    Nath.

    ReplyDelete
    Replies
    1. Please uninstall all wine from your system. Remove anything and everything that had to do with wine including winetricks , gecho , qt4wine etc. Install the wine software from the official ppa of wine.

      Delete
    2. Hello,
      I installed wine1.6
      But there seems to be some problem.
      when I gave the following cmd ,

      wine -v
      wine: cannot find L"C:\\windows\\system32\\-v.exe"

      is what I get.
      That means I have not yet got it right.
      pl.guide.

      nath.

      Delete
    3. In step 4 export WINEPREFIX="/home/user/.wineprefixes/office2010/" you might not have replaced user with your username. This can also create the same problem.

      Delete
  15. How to remove left over office 2007 shorcut in ubuntu 13.10 because I want to install this and I'm already uninstall office 2007 using wine,..

    please help me

    ReplyDelete
    Replies
    1. All the icons are in .local/share/applications folder in home directory. The .local directory is hidden, so press Ctrl+H in nautilus to unhide it. Delete the .desktop files belonging to MS office in this directory.
      To unset the default applications edit mimeapps.list in same directory. Remove the added associations as well as default applications pointing to ms-office. Keep others unaltered in this file.

      Delete
  16. hello,

    can you please help me with the step 7. I don't know which installer do you mean? and how to find it so I can copy it to home...etc

    ReplyDelete
    Replies
    1. hello,
      I executed the command in the note of step7 and I got this error :

      mohammed@mohammed-Inspiron-5537:~$ pwd
      /home/mohammed
      mohammed@mohammed-Inspiron-5537:~$ WINEPREFIX=/home/mohammed/.wineprefixes/office2010/ wine Setup.exe
      fixme:heap:HeapSetInformation (nil) 1 (nil) 0
      fixme:process:SetProcessDEPPolicy (1): stub
      fixme:heap:HeapSetInformation (nil) 1 (nil) 0
      fixme:process:SetProcessShutdownParameters (00000380, 00000000): partial stub.
      fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 0, std (d/m/y): 26/10/2014, dlt (d/m/y): 29/07/2014
      wine: cannot find L"C:\\windows\\system32\\Setup.exe"
      mohammed@mohammed-Inspiron-5537:~$

      Delete
    2. Hello,
      I found the "Installer" under /home/mohammed/.wineprefixes/office2010/drive_c/windows
      and Icopied it to home then cd to it then executed the command
      wine Setup.exe
      and I got this message :
      mohammed@mohammed-Inspiron-5537:~/Installer$ wine Setup.exefixme:heap:HeapSetInformation (nil) 1 (nil) 0
      fixme:process:SetProcessDEPPolicy (1): stub
      fixme:heap:HeapSetInformation (nil) 1 (nil) 0
      fixme:process:SetProcessShutdownParameters (00000380, 00000000): partial stub.
      fixme:ntdll:find_reg_tz_info Can't find matching timezone information in the registry for bias 0, std (d/m/y): 26/10/2014, dlt (d/m/y): 29/07/2014
      wine: cannot find L"C:\\windows\\system32\\Setup.exe"
      Can you help me?

      Delete
    3. Step 7 is for MS office installer. Please copy the contents of MSO CD to a folder in home. CD to the folder and then run the MSO setup using that command.

      Delete
  17. Everything worked great except macros. I still cannot run any Macros, I'm on Precise 64 bits

    ReplyDelete
    Replies
    1. Macros might have some other dependency. I have never used macros.

      Delete
  18. Hey. Just got this to work with Ubuntu 14.04/64bit and MS Office 2007 Home and Small Business. Didn't work the first time but second time was the charm. Many thanks.

    ReplyDelete
    Replies
    1. Ok. Thanks. I will update the article that it works in 14.10 also. :)

      Delete
    2. Your explanations and writing are really helpful. I notice a few people asking (and I tripped on this for a sec too) about "export WINEPREFIX="/home/user/.wineprefixes/office2010/". Maybe you could show that as .../home/$(whoami)/.wineprefixes/... instead. Then us lazy copy/pasters won't trip up.

      Delete