Results 1 to 6 of 6

Thread: Path environment Permanently

  1. #1
    Join Date
    Sep 2019
    Beans
    13

    Path environment Permanently

    Q1:can someone explain me where I have to put the
    3 path in ~/.profile ( what does mean the first . in : . "$HOME/.bashrc"):

    PATH="/usr/local/texlive/2019/bin/x86_64-linux:$PATH"
    PATH="~/Downloads/pythontex-master/pythontex:$PATH"

    PATH="~/Downloads/SageMath:$PATH"

    to have them permanently
    (please do not tell me the usual blabla -> type in a shell:

    export PATH="/usr/local/texlive/2019/bin/x86_64-linux:$PATH"
    export PATH="~/Downloads/pythontex-master/pythontex:$PATH"

    export PATH="~/Downloads/SageMath:$PATH"
    source ~/.bashrc

    because that does not work ! when I restart my PC and do a echo $PATH
    they have disapeared

    Code:
    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.
    
    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022
    
    # if running bash
    
    if [ -n "$BASH_VERSION" ]; then
        # include .bashrc if it exists
        if [ -f "$HOME/.bashrc" ]; then
            . "$HOME/.bashrc"
        fi
    fi
    
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
        PATH="$HOME/bin:$PATH"
    fi
    Q2: texlive ask me to add these 2 paths:
    export PATH="/usr/local/texlive/2019/texmf-dist/doc/man:$MANPATH"

    export PATH="/usr/local/texlive/2019/texmf-dist/doc/info:$INFOPATH"

    but why when I do a echo $MANPATH and echo $INFOPATH I see nothing
    I suppose these 2 env Vars do not exist ?

    Q3: sometime I got the message:
    ortollj@ortollj-SATELLITE-C70-B:~$ export PATH="/usr/local/texlive/2019/bin/x86_64-linux:$PATH"
    ortollj@ortollj-SATELLITE-C70-B:~$ export PATH="~/Downloads/pythontex-master/pythontex:$PATH"
    ortollj@ortollj-SATELLITE-C70-B:~$ export PATH="~/Downloads/SageMath:$PATH"
    ortollj@ortollj-SATELLITE-C70-B:~$ source ~/.bashrc

    Command 'lesspipe' is available in the following places
    * /bin/lesspipe
    * /usr/bin/lesspipe
    The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
    lesspipe: command not found
    Command 'dircolors' is available in '/usr/bin/dircolors'
    The command could not be located because '/usr/bin' is not included in the PATH environment variable.
    dircolors: command not found

    and the cmd ls is not known (I have to exit this shell and take a new one and ls still exist again !



    Last edited by ortollj; 1 Week Ago at 09:39 AM.

  2. #2
    Join Date
    Dec 2014
    Beans
    1,187

    Re: Path environment Permanently

    A1: Just put one line
    Code:
    PATH=$HOME/Downloads/SageMath:$HOME/Downloads/pythontex-master/pythontex:/usr/local/texlive/2019/bin/x86_64-linux:$PATH
    into ~/.profile before the block that checks for the existence of ".bashrc". No need to have three lines, no need for quotes (there's no characters in there that would make them necessary) and no export. 'export' marks a variable so it gets copied into the environment of new processes started by the shell. Once that marks is set, you don't need to re-set it after every change to the value of the variable.

    A2: MANPATH and INFOPATH tell the documentation readers 'man' and 'info' what directories to search for files. They aren't set on Ubuntu. I can't imagine any good reason to add them to PATH since there should be no executable files in directories listed in those variables. Are you sure texlive doesn't actually ask you to add '/usr/local/texlive/2019/texmf-dist/doc/man' to MANPATH and '/usr/local/texlive/2019/texmf-dist/doc/info' to INFOPATH ? That would actually make some sense ...

    A3: Probably some typo in the commands to set the PATH, likely a forgotten "$". PATH lists the directories to search for executables, if that list is wrong the system won't find the programs.

    Holger

  3. #3
    Join Date
    Sep 2019
    Beans
    13

    Re: Path environment Permanently

    thank you for your answer A1 it is ok now .
    about A2 you are right in fact textlive asked me :
    Add /usr/local/texlive/2019/texmf-dist/doc/man to MANPATH.
    Add /usr/local/texlive/2019/texmf-dist/doc/info to INFOPATH.

    But I'm still lost when I see this post:https://askubuntu.com/questions/6076...th-or-infopath
    what do I need to do precisely ?

  4. #4
    Join Date
    Sep 2019
    Beans
    13

    Re: Path environment Permanently

    so I did that ;

    Code:
    ortollj@ortollj-SATELLITE-C70-B:~$ echo $PATH
    /home/ortollj/bin:/home/ortollj/Downloads/SageMath:/home/ortollj/Downloads/pythontex-master/pythontex:/usr/local/texlive/2019/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    ortollj@ortollj-SATELLITE-C70-B:~$ export MANPATH=/usr/local/texlive/2019/texmf-dist/doc/man:$MANPATH
    ortollj@ortollj-SATELLITE-C70-B:~$ export INFOPATH=/usr/local/texlive/2019/texmf-dist/doc/info:$INFOPATH
    ortollj@ortollj-SATELLITE-C70-B:~$ source ~/.profile
    ortollj@ortollj-SATELLITE-C70-B:~$ echo $PATH
    /home/ortollj/bin:/home/ortollj/Downloads/SageMath:/home/ortollj/Downloads/pythontex-master/pythontex:/usr/local/texlive/2019/bin/x86_64-linux:/home/ortollj/bin:/home/ortollj/Downloads/SageMath:/home/ortollj/Downloads/pythontex-master/pythontex:/usr/local/texlive/2019/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    ortollj@ortollj-SATELLITE-C70-B:~$

    but the result is for me incomprehensible: certain path are now in duplicate!

  5. #5
    Join Date
    Dec 2014
    Beans
    1,187

    Re: Path environment Permanently

    'man' by default searches for manual pages in the directories given in '/etc/manpath.config'. If you set MANPATH to some list of directories only directories in that list are searched unless the list ends with a colon (':'), begins with one or contains a double colon. In that case the list of directories to search is generated from $MANPATH with the directories from the configuration put in the end or the beginning of the list or in place of the '::'.
    'info' searches for files in a default directory that AFAIK is compiled in (/usr/share/info seems to be the directory in question on Ubuntu). If you set INFOPATH, only a colon at the end is documented as getting replaced with the default directory.

    So putting
    Code:
    export MANPATH=/usr/local/texlive/2019/texmf-dist/doc/man:
    export INFOPATH=/usr/local/texlive/2019/texmf-dist/doc/info:
    after the PATH-line in ~/.profile should make the manual-pages and info documents available. Instead of setting MANPATH you could edit /etc/manpath.config or possibly create a user-specific configuration file '~/.manpath' and add a line saying
    Code:
    MANPATH_MAP /usr/local/texlive/2019/bin/x86_64-linux /usr/local/texlive/2019/texmf-dist/doc/man
    Holger

  6. #6
    Join Date
    Sep 2019
    Beans
    13

    Re: Path environment Permanently

    Thanks Holger.
    Last edited by ortollj; 1 Week Ago at 05:20 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •