How to view a PDF file in Linux
You can view PDF (Portable Document Format) documents in a Linux environment using several applications. Depending on your needs, we recommend LibreOffice if you need to edit a PDF and Evince if you need to view a PDF.
LibreOffice
LibreOffice Writer, which is part of the open source LibreOffice suite, does a great job opening, viewing, editing, and writing PDF documents.
Installing LibreOffice: Debian and Ubuntu
Debian and Ubuntu both use the APT (Advanced Packaging Tool) package management system. In your terminal, run the following command to install the LibreOffice software package:
sudo apt-get update && sudo apt-get install libreoffice
Installing LibreOffice: CentOS
In CentOS, download the LibreOffice package from the LibreOffice website that is appropriate for your system architecture. For instance, in this example, we downloaded LibreOffice_5.1.4_Linux_x86-64_rpm.tar.gz, an RPM (RPM Package Manager) package of LibreOffice 5.1.4 for 64-bit computers. The destination folder for the download is our Downloads directory.
Open a terminal and navigate to the directory where you downloaded the archive. For example:
cd ~/Downloads
The archive is a gzipped tar file. Extract it.
tar -xzvf LibreOffice_5.1.4_Linux_x86-64_rpm.tar.gz
The archive directory structure is extracted to the current directory. Change to the directory containing the RPMs:
cd LibreOffice_5.1.4.2_Linux_x86-64_rpm/RPMS/
Use the yum package manager to install all the RPM packages. Any required dependencies are also downloaded and installed.
sudo yum localinstall *.rpm
Installing LibreOffice: Fedora
Installing LibreOffice on Fedora is similar to installing on CentOS. First, download the RPM archive for your machine architecture from https://www.libreoffice.org. In this case, we downloaded the same 64-bit RPM archive as above, LibreOffice_5.1.4_Linux_x86-64_rpm.tar.gz.
Navigate to the directory where you downloaded the archive. For example:
cd ~/Downloads
Extract the archive.
tar -xzvf LibreOffice_5.1.4_Linux_x86-64_rpm.tar.gz
Navigate to the directory containing the RPMs.
cd LibreOffice_5.1.4.2_Linux_x86-64_rpm/RPMS/
Install all RPMs with the dnf package management tool. Dnf is similar to yum, but the command syntax is slightly different for installing local packages:
sudo dnf install *.rpm
Installing LibreOffice: OpenSUSE
OpenSUSE uses the zypper package management tool. From your terminal, run:
sudo zypper install libreoffice
Installing LibreOffice: Arch Linux
Arch Linux uses the pacman package manager. To install LibreOffice, run:
sudo pacman -S libreoffice
or:
su -c "pacman -S libreoffice"
Choose the package libreoffice-fresh or libreoffice-still. For the newest features, choose libreoffice-fresh. For the version that is the most reliably stable, choose libreoffice-still.
Evince PDF viewer
Evince is a lightweight program that loads and renders PDF documents in a clean, precise manner. You may prefer it to LibreOffice if all you need to do is view a PDF.
Installing Evince
Debian, Ubuntu:
sudo apt-get update && sudo apt-get install evince
CentOS:
sudo yum install evince
Fedora:
sudo dnf install evince
OpenSUSE:
sudo zypper install evince
Arch:
sudo pacman -S evince
Or, if your Arch system does not have sudo:
su -c "pacman -S evince"