نصب لیبره آفیس روی لینوکس

    From The Document Foundation Wiki

    نکات نصب

    نصب برای اولین بار روی گنو/لینوکس

    اگر شما تا کنون هرگز لیبره آفیس را روی گنو/لینوکس نصب نکرده اید یا صرفا می خواهید لیبره آفیس را نصب کنید ممکن است این دستورالعمل‌ها برای شما نباشد. یا به عبارتی به کارتان نیاید..

    به طور عادی  برای کاربران  شدیدا توصیه می کنیم از فرآیند نصب توزیع لینوکستان استفاده کنید. که به صورت گرافیکی امکان نصب را فراهم می سازد. می توانید به راهنمای توزیع لینوکستان  مراجعه کنید.
    


    The instructions below are for those who need to install LibreOffice packages directly from our site. This happens if the LibreOffice version that comes with your distribution has some configuration options that are undesired, or if you want to run a development or newer version than the one available at the distribution's repositories, or if your distribution has expired and no longer provides up-to-date software versions. If you just want to run a developer version of LibreOffice alongside with your distribution's version, we strongly recommend you to follow the instructions from this page. Our team member Wolfgang Pechlaner has written a script to do this for (open)SuSE which also work with slight changes on Ubuntu. This may also work for other RPM or DEB based distributions, but has only be verified to work on openSuSE and Ubuntu.

    In any case these instructions are void of any liability, and it is strongly advised that you do a thorough backup of your data (e.g. your home directory) before proceeding.

    There is a script, at the bottom of this wiki, to make the whole job much easier. It is written for .deb installers but can be modified for .rpm.

    Should I uninstall the LibreOffice that comes with my Distro?

    No, though we advise users to install these packages in a "clean" environment in case of a problem. It should not be a major problem to have as many versions of LibreOffice as you wish, but there are some reported installation problems and there are theoretical problems with conflicts in these cases. Again, nothing bad should derive from this, but it could be the reason for some unexpected hassle.

    For instructions on how to do that, please read the section below entitled Uninstalling LibreOffice.

    Where to find official installation support?

    These instructions are also presented in the "README" file included with the downloaded archive files (look in the "readmes" directory). That official information is maintained by the LibreOffice Documentation Team, and is stored at the following address.

    Will I have to be a coder / programmer to install LibreOffice?

    In most modern GNU/Linux distributions, the desktop is well integrated with the installation process, so it is very likely that if you have a stock Debian or its derivatives (Ubuntu, Aptosid, Mint, etc.), Mandriva (or Mageia), openSUSE, or any other distribution on your system, you could do a full LibreOffice installation without having to type a single line of code.

    For those who use KDE, the plot thickens. It seems Adept (when present) has some issues. So, if you encounter problems, please use the Terminal-Based Install instructions instead.

    Installation of LibreOffice on GNU/Linux systems

    Find your installation, language and help packages

    Please go to our download page.

    Installation packages are available for 32-bit and 64-bit systems, in the “x86” and “x86_64” flavors, respectively, together with language and help packs for obtaining a LibreOffice installation in your preferred language. Download the appropriate packages for your system, distribution, and language. Put it anywhere convenient and accessible to you; e.g. in a directory you've created named "LibreOffice" in your home directory.

    The rest of this document assumes, that you are installing the base (en-US) package, but if you are also installing a help pack or a language pack, all you need to do is after installing the base (en-US) package, do the same steps all over again with these extra packages.

    The instructions are for installing LibreOffice in US English (en-US, the basic installation), on a 32-bit system. There will be differences in some directory and file names if you are installing a different version (i.e. 64-bit, another language than en_US, .deb or .rpm), but the process is basically the same, and – hopefully – you will find these instructions easy to follow.

    The download page above – hopefully – will have determined if you want to download a .deb – for Debian based distributions (Debian, Ubuntu, *buntu, Aptosid, Knoppix, etc...) – or an .rpm package for RPM based ones like Fedora, Mandriva, openSUSE, CentOS, Mageia, and other .rpm systems. If it doesn't, please use the change? link below the download button to make your selection.

    We have put a lot of work in LibreOffice being able to be installed by anyone. So if you have a stock (out of the box) installation of one of the many GNU/Linux distributions, this section is for you. We are assuming that you have already downloaded the appropriate packages for your system (if not please read the previous section)

    You should be looking at a file called something like:

    LibreOffice_<your downloaded version>_Linux_x86_install-deb.tar.gz

    (where "<your downloaded version>" is your downloaded version like "5.1.5.2", "5.2.2.2" or something else. For simplicity's sake, we will use "$version" in the following text. You should remember there to replace it with your downloaded version.) which we affectionately call a "tarball". This is a special type of file that serves as an archive. It is actually a collection of folders and files that are packaged together under one file name (that's what ".tar" signifies), and makes downloading easier. The file is also compressed for quicker downloads; identified by the ".gz" part.

    NOTE: The file name you end up with can be quite different from these examples; the ".tar.gz" is the common element though. The changes occur if you are running a 64bit system (then it will have a "x86_64" instead of "X86" in its name) or if you are running an RPM based system (then it would contain an "-rpm" instead of "-deb"). But the instructions work the same, regardless of the variations.

    We will try to make as much sense as possible. If any of these instructions won't work for you, we have instructions for a detailed Terminal-Based Install that is guaranteed to work, in the next section.

    Graphic Installation (Preferred Way)

    Attention: This paragraph may be outdated. If you can confirm that these instructions still work, remove this line. If you find any errors in these parts, feel free to correct them.

    Unpacking the Tarball

    • Click on your downloaded package (or right-click on it and choose "Open With" and select your preferred unpacking tool).
    • Extract the package to a location where you have easy access to (a directory in your home directory would be fine).
    • You should now have a folder that is called something like: LibreOffice_$version_Linux_x86-deb/ (remember that names can vary somewhat, as explained earlier).

    Installation of Multiple Packages

    • Change into the unpacked folder. In it, you will see some directories (one called "readmes with a README_en-US file) and a DEBS/ (or RPMS/) folder.
    • Change into the last mentioned folder.
    • Select ALL files within this folder.
    • Right-click on them and in the drop-down menu select something like "Open with Package Manager" or "Open with Install Tool" (the wording here is defined by your distribution, desktop environment/manager and/or installed packages).

    Attention: Some users have reported problems while trying to select and install multiple packages with the "Package Manager" tool of their distribution (specially Ubuntu). This step might result in the package manager/installer opening multiple windows at once, which can hang your system (e.g. with GDebi). Please try to use Synaptic (if it is already installed. Otherwise you need to install it first.) for this step if you encounter problems, or go directly to the Terminal-Based Install instructions below.

    • You will be prompted for the root (or on *buntu and maybe other distributions your user) password.
    • You may be prompted to install dependencies. Generally, the system will tell you if these dependencies will break something, so if you don't see a message that freaks you out, it is OK to say yes here.
    • If all goes well, and you don't see any error messages from your system, it is safe to say we have succeeded. The program is installed now. To be sure you can open a terminal and type
    $ libreoffice
    

    (you could also try "soffice", if this does not works for you). If LibreOffice doesn't start up, see Testing the Installation below. But be aware: if you want to install a language pack for a different GUI language than en_US and want to use this language from the beginning, then you should wait with this test after installing the language pack. Otherwise you need to change the GUI language later to your preferred language.

    • Now you can open the LibreOffice suite via your system's Programs > Office menu, and it even could be that LibreOffice is already your default Office Program (click a spreadsheet file to make sure).

    Terminal-Based Install

    The following instructions are for advanced users or for users who encountered problems during the Graphical Install. We have tested LibreOffice in a lot of distributions. It can be installed in all of them, so these instructions should work. If they don't work for you, we suggest you to follow these steps:

    • Make sure you haven't a corrupt download. Do a checksum, or just try to download the package again.
    • Make absolutely sure you are downloading the package that matches your system. Common errors include trying to install a 64bit package on a 32bit system, or trying to install an .rpm in a .deb based distribution (or the other way around).
    • Make absolutely sure you have root or sudo privileges. If not, the installation will fail. Become root or use sudo.

    So here is the detailed terminal-based way to install LibreOffice:

    Unpack the Downloaded Archive via Terminal

    Open a command line (e.g. Konsole, GNOME Terminal, XFCE Terminal etc.) and change to the location where you downloaded the tarball. Now we'll decompress and unpack the package file. You should type:

    For the .deb:

    $ tar zxvf LibreOffice_$version_Linux_x86-deb.tar.gz 
    
    Remember, ^--- use your downloaded file-name --^ here.

    For the .rpm:

    $ tar zxvf LibreOffice_$version_Linux_x86-rpm.tar.gz
    

    When you have unpacked the downloaded archive, you will see that the contents have been decompressed into a directory called something like "LibreOffice_$version_Linux_x86-deb" (or -rpm) (with naming differences depending on what you have downloaded).

    Installing via Terminal

    Change to the unpacked directory:

    For the .deb

    $ cd LibreOffice_$version_Linux_x86-deb/
    

    For the .rpm

    $ cd LibreOffice_$version_Linux_x86-rpm/
    

    The "LibreOffice_$version_Linux_x86-deb" (or rpm) directory contains a sub-directory called DEBS/ (or RPMS/). Change to this directory

    $ cd DEBS/ 
    

    or

    $ cd RPMS/
    

    Enter the following command to have your system incorporate and recognise the installation (you will be prompted to enter your root or user password (depending on a distribution without a root user like *buntu etc) before the command will be executed):

    دبیان / اوبونتو / مینت
    $ sudo dpkg -i *.deb
    

    (اگر از توزیعی استفاده می کنید که sudo روی آن نصب نیست ممکن است بخواهید sudo را نصب و پیکربندی کنید؛ در غیر این صورت دستور را از یک پایانه root اجراکنید، یا از "su -c 'dpkg -i *deb'" استفاده کنید.)

    Fedora / CentOS
    $ su -c 'yum install *.rpm'
    
    Mandriva / Mageia
    $ su -c 'urpmi *.rpm'
    
    openSUSE and other RPM based systems
    $ su -c 'rpm -Uvh *.rpm'
    
    Gentoo

    A binary LibreOffice is available in the portage repository:

    # emerge libreoffice-bin
    

    http://packages.gentoo.org/package/app-office/libreoffice-bin

    Testing the Installation

    The above commands do the first part of the installation process, unpacking most software in /opt/libreoffice$version/. Make sure we succeeded by calling:

    $ libreoffice
    

    or perhaps

    $ libreoffice$version
    

    (where "$version" could be something like "5.1" or "5.2" etc) or just only

    $ soffice
    

    You should see the LibreOffice splash screen if all went well.

    If you fire up the wrong version, you may need to fix soft links. Verify the misbehaving command, for example like so:

    $ ls -ld $(which soffice) /usr/lib/libreoffice
    

    If you have, say,:

    lrwxrwxrwx 1 root root 20 Sep 20 13:04 /usr/lib/libreoffice -> /some/libreoffice$wrongversion/
    

    you can fix it like so:

    $ sudo rm /usr/lib/libreoffice
    $ sudo ln -n -s /opt/libreoffice$version/ /usr/lib/libreoffice
    

    If LibreOffice doesn't fire up or you get an error message like "command not found", the command name may have been changed. Type an abbreviated part of the likely name, for example:

    $ libreof
    

    then hit [Tab] to see if the complete command name comes up. If so, just hit [Enter] to try it. If that didn't work, look at your GUI screen's Menu > Office segment. It may already be available there.

    Otherwise, you can go back to our internet documentation or forum pages for help.

    But be aware: if you want to install a language pack for an other language as en_US for your GUI language and want this language from the first start of LibreOffice, you should wait with this test until you have installed the langauge pack.

    Note the ppa at Lauchpad is now almost always in sync with upstream, so please use that version whenever possible. Other distributions may have also a repository with newer versions of LO than in your distribution. If this is the case, use your distribution's repository whenever possible.

    The installation process is now completed, and you should have icons for all the LibreOffice applications in your desktop's Applications > Office menu.

    Other Distributions

    It should be easy to install LibreOffice in other GNU/Linux distributions not specifically covered in these installation instructions. Besides the .deb and .rpm we make it possible to download source code tarballs from https://www.libreoffice.org/download/. But it may also be possible that your distribution has a repository with newer versions of LibreOffice (especially distributions with "rolling releases"). So it might be easier to add their repository instead of compiling your own LibreOffice version.

    Setting Up a Language Pack

    After you installed your language pack (follow the same instructions as described in Installing the main (en-US) pack you will need to set up your LibreOffice suite so it will be in your language.

    Start one of the LibreOffice applications – Writer, for instance.

    Go to the menu and select Tools ▸ Options.

    In the Options dialog box, click on Language Settings and then click on Languages. Open the User interface list and select the language you just installed. If you want, do the same thing for the Locale setting, the Default currency, and the Default Languages for Documents.

    After adjusting those settings, click on OK. The dialog box will close, and you will see an information message telling you that your changes will only be activated after you exit LibreOffice and start it again (remember to also exit the QuickStarter if it is running). With newer versions (from 5.2 on) you will get a dialog box, which offers you the possibility to restart LibreOffice. If you have not opened a new file or an existing one, and have edited it yet, it is save to say Restart Now here.

    The next time you start LibreOffice, it will start in the language you just have chosen. For example if you installed pt-Br (Brazilian Portuguese) when you start your LibreOffice, the splash screen will show the all familiar LibreOffice. Nice isn't it?

    Installing a Help Pack

    If you do not want to use an internet connection when tipping your "F1 button or using "Help - LibreOffice Help, you can also download your needed help pack in your preferred language. Just follow the instructions from Installing the main (en-US) pack but replace the instructions with your downloaded help pack.

    Uninstalling LibreOffice

    Uninstalling a previous version when you install an upgraded one helps to prevent conflicts. Usually upgrades are dealt with by the same tool that deals with updates but this seldom works for alpha or beta testing or pre-release versions.

    As seen in the installation process, GNU/Linux distributions have come a long way to make installing software as easy as possible. This also applies to uninstalling packages.

    Open your system's package manager and find the search tool.

    Search for libreoffice.

    Deselect or select for removal the first package found. The package manager tool will (hopefully) ask you if it should remove other dependent packages. As we of LibreOffice pack all we needed in our installation packages, it should be pretty safe to say yes.

    Then scroll the list of the search box again to see if all the libreoffice packages are deselected / selected for removal, if you find any of them still not deselected / selected for removal, select them, and continue to remove them until all are removed (in testing environments it was necessary no more than 3 of these steps).

    At some point you will be prompted to uninstall packages that start with libobasis, it is recommended that you uninstall these too (if you are not prompted, do a search with the term libobasis to see if you find anything). There may be also other packages if you want to uninstall your distribution's version of LibreOffice. Depending on your system's preselection of LibreOffice modules and its dependent packages, there could also be packages like python3-uno, uno-libs3 or some other packages. You should also uninstall them, if nothing else depends on them.

    After you apply these changes the LibreOffice suite should have been removed from your system, to make sure try to find any menu entries, and to be double sure type in a terminal:

    $ libreoffice
    

    or

    $ soffice
    

    If the LibreOffice splash screen appears you can try to find any packages left behind in the package manager. If you made double sure there aren't any, reboot and try the above command again.

    After you have uninstalled all the packages and the above command returns an error about missing modules or libraries (or just hangs without releasing your prompt), you could try to see if LibreOffice left anything behind: To ensure the cleanest possible removal of a previous installation of LibreOffice, you can optionally also execute the following commands in a terminal window, and then manually delete any remaining files discovered:

    #updatedb 
    #locate libreoffice | less
    

    or

    # find / -name "libreoffice"  -print 2>/dev/null
    

    Skipping this optional step will not have any serious consequences for your system (not even for a future install or upgrade to LibreOffice). You will just have a small number of obsolete files taking up a very small amount of disk space.

    • If you tried all of the above and could not uninstall or had any problems, we will have to go to a Terminal to fix this.

    Terminal Based Uninstall

    Debian / Ubuntu

    $ su -c 'apt-get purge libreoffice? libobasis?
    

    (on Debian and maybe other Debian based distributions, or without sudo installed)

    $ sudo apt-get purge libreoffice? libobasis?
    

    (on *buntu and maybe other Debian based distributions)

    or

    $ sudo aptitude purge libreoffice? libobasis?
    
    • Remember to put the "?" wild-card so ALL the LibreOffice packages get purged / uninstalled (in apt-get or aptitude the "*" may NOT be a wild-card on some distributions)

    Fedora

    $ su -c 'yum remove libreoffice*'
    

    Mandriva

    $ su -c 'urpme libreoffice*'
    

    openSUSE and other RPM based systems

    $ su -c 'rpm -ev --allmatches libreoffice'
    

    It is possible that the above command will give you

    error: package libreoffice is not installed
    

    In this case, try these 2 commands:

    sudo zypper rm --clean-deps libreoffice*
    sudo zypper rm --clean-deps libobasis*
    


    GUI Based Uninstall

    openSUSE

    The GUI way to uninstall LibreOffice on openSUSE

    Even if you installed the RPMs using the command line, it is possible to use the GUI to uninstall LibreOffice.

    Start -> Applications -> System -> YaST Software
    It will ask you to enter your admin password.
    A window will open. TITLE = YaST2
    On the left side, click on the View tab, a menu will drop down.
    Select Repositories
    On the left side, it might show:
    @System
    Select @System
    On the right side, the list of packages is long.
    Find libobasis7.2-core and uncheck it. (in this case, the version number of the library is 7.2)
    A Warning window shows up. Select the first option: We want to do a deinstallation (uninstallation).
    Click the OK -- Try Again button
    Make sure that all the packages starting with libobasis have a minus sign in their front.
    For example, you need to uncheck libobasis7.2-ooofonts (in this case, the version number of the library is 7.2)
    Now, search for packages starting with libreoffice. Make sure that they all have a minus sign in their front.
    Now, we are ready.
    At the bottom right, click on the Accept button.
    YaST will now remove LibreOffice. It might take 2 min.
    It will eventually say Installation Successfully Finished. That’s normal. LibreOffice has now been removed.
    

    اسکریپت برای نصب

    Mr ZenWiz from the User Support Mailing List kindly wrote a script to do the whole job for Debian-based distros such as Mint, Ubuntu and many others. For people using the Redhat Package Management system the script needs a little editing. Hopefully at some point we might have both scripts here. Also it would be good if we manage to upload the script-files to make it easier for people to use.

    This script may not work as expected (or at all). On Debian Testing AMD64, it spits out errors without doing anything. If you know how to fix it, change it adequately, but talk to mr ZenWiz before.

    #!/bin/bash
        
    # A script to install or update libreoffice releases properly
        
    if [[ "$1" == "-x" ]]; then
        shift
        set -x
    fi
        
    me=`basename $0`
    Usage() {
        echo "Usage: $me [-x][-h|--help] <gzipped-tarball> [<gzipped-tarball>...]"
        exit 0
    }
        
    if [[ -z "$1" || "$1" == "-h" || "$1" == "--help" ]]; then Usage; fi
        
    # Change these to install on rpm base systems
    tgt=DEBS
    cmd="dpkg -i"
    sfx=deb
        
    for tb in $*; do
        if [[ ! -f $tb ]]; then
            if [[ -f "$tb.tgz" ]]; then
                tb="$tb.tgz"
            elif [[ -f "$tb.tar.gz" ]]; then
                tb="$tb.tar.gz"
            else
                echo "Can't find $tb or $tb.tgz or $tb.tar.gz - skipping..."
                read ln
                continue
            fi
        fi
        
        # find out what the name of the uncompressed subdirectory will be
        dst=`tar tzf $tb 2> /dev/null | head -1 | awk -F/ '{print $1}'`
        tar xzf $tb
        if [[ ! -d $dst/$tgt ]]; then
            echo "Can't find $me directory $dst/$tgt - skipping..."
            read ln
            continue
        fi
        
        # install or update, depending on how I was called
        cd $dst/$tgt
        case $me in
            loinst)
                sudo $cmd *.$sfx
                if [[ -d desktop-integration ]]; then
                    cd desktop-integration
                    sudo $cmd *.$sfx
                    cd ..
                fi
                cd ../..
            ;;
            loupdate)
                cd ..
                sudo ./update
                cd ..
            ;;
        esac
        
        # delete the installation directory
        /bin/rm -rf $dst
    done
        
    echo ""