echo "rm -rf $TERMUX_PREFIX/etc/profile.d/texlive.sh" >> preinst
echo "rm -rf $TERMUX_PREFIX/opt/texlive/2016" >> preinst
# Let's not delete the previous texmf-dist so that people who have installed a full distribution won't need to download everything again
echo "rm -rf $TERMUX_PREFIX/opt/texlive/2017/!(texmf-dist)" >> preinst
echo "exit 0" >> preinst
chmod 0755 preinst
echo "rm -rf $TERMUX_PREFIX/etc/profile.d/texlive.sh" >> preinst
echo "rm -rf $TERMUX_PREFIX/opt/texlive/2016" >> preinst
# Let's not delete the previous texmf-dist so that people who have installed a full distribution won't need to download everything again
echo "rm -rf $TERMUX_PREFIX/opt/texlive/2017/!(texmf-dist)" >> preinst
echo "exit 0" >> preinst
chmod 0755 preinst