Web TexLive Installation on Ubuntu
(posted 2020.03.26, last updated 2020.03.26)

Lately, I started using XeTex, and had some issues using the packages from the ubuntu repository.

Luckily it is quite easy to install the latest TexLive in Ubuntu.

Installation

# TexLive [web install] #########################

cd
mkdir install-tl && cd install-tl
wget -O - -- http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz | tar xzf - --strip-components=1
apt install -y tex-common texinfo equivs perl-tk

cat << EOF > texlive.profile
selected_scheme scheme-custom
TEXDIR /usr/local/texlive/2019
TEXMFCONFIG ~/.texlive2019/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSCONFIG /usr/local/texlive/2019/texmf-config
TEXMFSYSVAR /usr/local/texlive/2019/texmf-var
TEXMFVAR ~/.texlive2019/texmf-var
binary_x86_64-linux 1
collection-basic 1
collection-binextra 1
collection-fontsrecommended 1
collection-fontutils 1
collection-games 1
collection-langenglish 1
collection-langgerman 1
collection-latex 1
collection-latexextra 1
collection-latexrecommended 1
collection-mathscience 1
collection-pictures 1
collection-plaingeneric 1
collection-xetex 1
instopt_adjustpath 1
instopt_adjustrepo 1
instopt_letter 0
instopt_portable 0
instopt_write18_restricted 1
tlpdbopt_autobackup 1
tlpdbopt_backupdir tlpkg/backups
tlpdbopt_create_formats 1
tlpdbopt_desktop_integration 1
tlpdbopt_file_assocs 1
tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 1
tlpdbopt_install_srcfiles 1
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/info
tlpdbopt_sys_man /usr/local/man
tlpdbopt_w32_multi_user 1
EOF

./install-tl -profile texlive.profile

cd .. && rm -r install-tl

# Fix WSL bug regarding fakeroot
sudo update-alternatives --set fakeroot /usr/bin/fakeroot-tcp

# Pseudopackage for texlive
apt-get install -y freeglut3
mkdir /tmp/tl-equivs
cd /tmp/tl-equivs
wget https://www.tug.org/texlive/files/debian-equivs-2019-ex.txt
equivs-build debian-equivs-2019-ex.txt
dpkg -i texlive-local_*_all.deb

References