Add the lines
export PATH=/usr/local/texlive/2016/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2016/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2016/texmf-dist/doc/info:$INFOPATH
to $HOME/.profile
. As a user of bash
I also have the line
source ~/.profile
in $HOME/.bashrc
.
In order for the change to affect not only newly started shells, but also programs managed by the GUI, you have to start a new session.
Problems with evince and a local TeXLive installation under Ubuntu
(This addresses an issue raised in the comments below the answer.)
The document viewer Evince may exhibit two problems when trying to view dvi files in this arrangement.
Evince fails to display dvi files. When starting it from the command line, you see messages like
kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+100/600 --dpi 700 cmss12
mktexpk: Permission denied
Evince is supervised by apparmor, a kernel module for preventing applications from doing mischief, and is forbidden to use TeXLive in \usr\local
. You can either switch off supervision completely by
sudo aa-disable /usr/bin/evince
(aa-disable
comes with the apparmor-utils
package), or you modify the apparmor rules. Add the following lines to /etc/apparmor.d/abstractions/evince
:
# TeXlive 2016
/usr/local/texlive/2016/bin/x86_64-linux/mktexpk Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/mktextfm Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/dvipdfm Cx -> sanitized_helper,
/usr/local/texlive/2016/bin/x86_64-linux/mkofm Cx -> sanitized_helper,
/usr/local/texlive/** r,
and the following lines to /etc/apparmor.d/abstractions/ubuntu-helpers
:
# TeXlive 2016
/usr/local/texlive/2016/texmf{,-dist}/web2c/{,**/}* Pixr,
/usr/local/texlive/2016/bin/x86_64-linux/* Pixr,
Insert the lines near similar-looking rules for Ubuntu-TeX. For these changes to take effect without rebooting, issue the command
sudo service apparmor restart
Evince re-generates fonts each time a dvi file is viewed. When starting it from the command line, you see messages like
kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+100/600 --dpi 700 cmss12
mktexpk: /home/someuser/.texlive2016/texmf-var/fonts/pk/ljfour/public/cm/cmss12.700pk already exists.
This is caused by Evince not finding the new configuration file for TeXLive 2016. The problem can be solved by putting a link to it into the folder /usr/local/share/texmf/web2c
:
sudo mkdir -p /usr/local/share/texmf/web2c
sudo ln -s /usr/local/texlive/2016/texmf-dist/web2c/texmf.cnf /usr/local/share/texmf/web2c/texmf.cnf
Tested for
TeXLive 2016, Ubuntu 16.04, evince 3.18.2
TeXLive 2016, Ubuntu 16.10, evince 3.22
Most importantly, add /usr/local/texlive/2016/bin/x86_64-linux to your PATH for current and future sessions
?echo $PATH
after you have done what gemot asked (remember, it might be a good idea to log out and in again)