https://yihui.org/tinytex/ is a lifesaver for Tex Live users. Some commands I use regularly:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# fresh install
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh

# save the package list
tlmgr list --only-installed --data name > my_tex_packages.txt

# restore installed packages
tlmgr install $(cat my_tex_packages.txt | tr '\n' ' ')

# keep packages up to date
tlmgr update --self --all

# install packages used by this tex file
texliveonfly.py main.tex