4

I installed LaTeX/texlive yesterday (say, day X) using apt. The exact command I've use was:

sudo apt-get install texlive-full

but now (day X+1) I'm having troubles when I try to use the physics2 package in my document. For example, the code

\documentclass[12pt]{book}
%\usepackage{physics2}
\begin{document}

asdasd

\end{document}

works perfect but when I uncomment \usepackage{physics2}, it doesn't work. I belive that I don't have the package physics2 installed because I got this error:

File 'physics2.sty' not found

I'm using Ubuntu 22.04.1 LTS. When I try to use sudo tlmgr install physics2 (or to update) I get:

(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
TLPDB: not a directory, not loading: /home/peluche/texmf
tlmgr: user mode not initialized, please read the documentation!

(I already read the documentation but I don't fully understand what I have to do or to initialize). Any idea how to make physics2 package work? (I'm still a noob at Ubuntu and LaTeX's errors/packages by the way)

Peluche
  • 613
  • 2
    Did you install texlive via apt or the independent installer (https://tug.org/texlive/)? – Dai Bowen Feb 12 '23 at 17:37
  • By using apt, yes. The exact command I used was sudo apt-get install texlive-full. I installed LaTeX (texlive) yesterday – Peluche Feb 12 '23 at 17:38
  • 2
    update your texlive usig apt, you an use texlive-full or seach which apt package it is in – David Carlisle Feb 12 '23 at 17:38
  • @DavidCarlisle I believe I have the lastest version of texlive: TeX 3.141592653 (TeX Live 2022/dev/Debian). Should I look here the package? – Peluche Feb 12 '23 at 17:48
  • 1
    physics2 has only been on CTAN for a few days, while I am seeing it as available through tlmgr on a vanilla install, it might take a while before it's added to the Ubuntu packages. – Dai Bowen Feb 12 '23 at 17:49
  • oooh, I didn't know that. Now it makes more sense why it didn't get installed – Peluche Feb 12 '23 at 17:53
  • You installed TeXlive as root, yet you seem to update TeXlive as user. That will result in a conflict between directories as the root install makes the distribution systemside available . What does the command sudo tlmgr install physics2 result into? – alchemist Feb 12 '23 at 17:53
  • Using sudo tlmgr install physics2 gets the same result/error/warning – Peluche Feb 12 '23 at 17:55

1 Answers1

7

As you've installed TeX Live via apt, you have the Ubuntu-packaged version of TeX Live and should be updating it by updating texlive-full via apt, rather than trying to use tlmgr.

With texlive-full you should have all pacakges, but physics2 has only been on CTAN for a few days and so it will take some time before the Ubuntu-package TeX Live is rebuilt to include it.

In the meantime physics2 does appear to be available via tlmgr on a vanilla install, so you could remove the apt-installed texlive-full and instead use the TeX Live installer at https://tug.org/texlive/, or attempt to manually install physics2 independently of apt/tlmgr following How do I install an individual package on a Linux system?.

Dai Bowen
  • 6,117