<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <ol>
      <li>If i <i>export</i> <i>PATH</i> it's valid for the current
        session and rebooting cancels it unless it's permanently stored
        in <i>.profile</i>.</li>
      <li><font color="#002eff">peacecop@peacecop-HP-ProBook-4520s:~$
          type -ap tlmgr</font><br>
        <font color="#ff0000">/usr/local/texlive/2022/bin/x86_64-linux/tlmgr<br>
          /usr/local/texlive/2022/bin/x86_64-linux/tlmgr<br>
        </font><font color="#002eff">peacecop@peacecop-HP-ProBook-4520s:~$
          type -ap tex</font><br>
        <font color="#ff0000">/usr/local/texlive/2022/bin/x86_64-linux/tex<br>
          /usr/local/texlive/2022/bin/x86_64-linux/tex<br>
          /usr/bin/tex<br>
          /bin/tex</font></li>
      <li><font color="#002eff">peacecop@peacecop-HP-ProBook-4520s:~$ ls
          -l /usr/local/texlive/2022/bin/x86_64-linux | grep 'tlmgr'</font><br>
        <font color="#ff0000">lrwxrwxrwx 1 root root       41 okt    4 
          2018 tlmgr -> ../../texmf-dist/scripts/texlive/tlmgr.pl</font></li>
      <li><font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$
          mkdir -p ~/.config/environment.d/<br>
          peacecop@peacecop-HP-ProBook-4520s:~$ echo
          'PATH=/usr/local/texlive/2022/bin/x86_64-linux/:${PATH}' >
          ~/.config/environment.d/texlive-path.conf<br>
        </font>After reboot, <i>TeXstudio</i> works like before and no
        <i>sudo</i> is needed. Even <i>tex-locale</i> is found.
        However, <i>tlmgr</i> still acts weird:<br>
        <font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$
          tlmgr install tex-locale<br>
        </font><font color="#ff0000">You don't have permission to change
          the installation in any way,<br>
          specifically, the directory /usr/local/texlive/2022/tlpkg/ is
          not writable.<br>
          Please run this program as administrator, or contact your
          local admin.<br>
          tlmgr: An error has occurred. See above messages. Exiting.</font><br>
        <font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$ sudo
          tlmgr install tex-locale<br>
        </font><font color="#ff0000">[sudo] password for peacecop: <br>
          sudo: tlmgr: command not found</font><br>
        <font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$
          which tlmgr<br>
        </font><font color="#ff0000">/usr/local/texlive/2022/bin/x86_64-linux/tlmgr<br>
          <font color="#000000">If i do just <i>tlmgr list</i> then i
            get the list.</font><br>
        </font></li>
      <li><i>bash</i></li>
      <li><font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$
          env | grep -i tex<br>
        </font><font color="#ff0000">MANPATH=/usr/local/texlive/2022/texmf-dist/doc/man:<br>
          INFOPATH=/usr/local/texlive/2022/texmf-dist/doc/info:<br>
PATH=/usr/local/texlive/2022/bin/x86_64-linux:/usr/local/texlive/2022/bin/x86_64-linux:/home/peacecop/.local/bin:/usr/local/texlive/2022/bin/x86_64-linux/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin</font><br>
        <font color="#0039ff">peacecop@peacecop-HP-ProBook-4520s:~$ sudo
          env | grep -i tex<br>
        </font>no output</li>
      <li>Done that, no change.<br>
        <br>
      </li>
    </ol>
    <div class="moz-cite-prefix">On 29.07.22 01:58, Max Chernoff wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:38fbda88e518182475fb73e3671cca39e955310a.camel@telus.net">
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">You probably missed the part of my report that had it in already:
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Yep, I completely missed that. Whoops.

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">As you see, i the /2022/ version was installed, /PATH/ was renewed and
still, it complains that the version is /2021/.

Your suggested command does the same thing.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">I'm not too sure what's going on here, but I have a couple of potential
ideas:

1. Have you tried rebooting since you installed TL? Sometimes the
profile file is only source'd on login, so this may solve the problem.

2. What do you get when you run:

   type -ap tlmgr
   type -ap tex
   
On my system, I get:

   $ type -ap tlmgr
   /usr/local/texlive/2022/bin/x86_64-linux/tlmgr
   
   $ type -ap tex
   /usr/local/texlive/2022/bin/x86_64-linux/tex
   
If you aren't getting TL 2022 as the first result for both commands
(which I strongly suspect is the case), that means that you're going to
have problems (which you are).

3. There's a chance that there's a weird permission thing going on here.
What do you get when you run:

   ls -l /usr/local/texlive/2022/bin/x86_64-linux | grep 'tlmgr'
   
I get:

   lrwxrwxrwx. 1 root root       41 Oct  3  2018 tlmgr -> ../../texmf-dist/scripts/texlive/tlmgr.pl
   
4. I've sometimes had better luck using systemd-environmentd to set
environment variables. You can try running

   mkdir -p ~/.config/environment.d/
   echo 'PATH=/usr/local/texlive/2022/bin/x86_64-linux/:${PATH}' > ~/.config/environment.d/texlive-path.conf
   
then reboot. Does this fix anything?

5. Are you using bash as your shell? If you're using Zsh, ksh, or csh,
then there may be some special way of adding things to your path that
I'm not aware of. I'm using fish, so I would need to run
"fish_add_path".

6. You said that using sudo works. What do you get when you run:

   env | grep -i tex
   sudo env | grep -i tex
   
I get:

   $ env | grep -i tex
   PATH=/opt/context/tex/texmf-linux-64/bin:/usr/local/texlive/2022/bin/x86_64-linux:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
   
   sudo env | grep -i tex
   (no output)
   
7. You can try clearing the bash PATH cache by running:

   hash -r

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Should i run /TeXstudio/ as /sudo/ further on? Is that normal?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Probably not a great idea. 

Anyways, this is all the ideas that I have. Hopefully someone else can
be more helpful, since I'm doubtful that any of these solutions will
work.

-- Max
</pre>
    </blockquote>
  </body>
</html>