You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
User:Dvorapa/Toolforge for beginners/Tool environment
Once you know how to use the tool, you maybe wonder how to adjust its environment to your needs. Perhaps you are asking, how to adjust the command line colors or some other behavior, set specific command preferences or aliases, perhaps install specific package or specific version, etc. Well, you should understand that Toolforge environment is limited to most users needs and also to server capabilities. But do we have any option to adjust our tool's environment? Yes, we do!
The folder you are redirected after login/become is your home folder. It is stored in
/home/username in case of user account or
/data/project/my_tool in case of tool account. The Toolforge home folder basically works the same as the home folder on your own PC (
%appdata%). There are several basic files, that define your tool environment:
This file contains an information about your selected editor. To set the editor, you can use the following command:
The default option is the editor nano. This is also default if you don't use the command or don't have the file created.
This file contains a set of commands to run on every login/become. You can
export environment variables here or
alias favourite commands like:
alias ls='ls --color'
to color the ls output.
- .gitconfig, .subversion/config, etc.
If you are going to use version control system and want to set your global .gitconfig file, you can do it right here too.
As we mentioned above, Toolforge package listing is limited to most users needs and also the package versions are limited to Debian repositories most of the time.
If you want to install your own package, you can always ask developers to add it in here. They are usually really helpful, but don't expect they will add everything you need or want. Additionally they can not install one package in multiple versions and also can not install a version, that is not in official Debian repositories.
- package system
pip install --user or
npm install ~/local-folder, you can use this option.
Mostly these package systems save the packages into the
.local folder. You can install any package from package system repositories, specific versions, everything to your needs. But of course you still can not install multiple versions of one package at once into one tool.
- project dependencies
You can create as many projects as you want and you can install as many different packages as possible. You basically create this small virtual unit in your folder system, set up its dependencies to your needs and then reach its contents when you need it.
- virtual environment
Some programming languages, like Python go even further and allow you to create so-called virtual environment. It is basically similar to projects, but emulate the command line inside the command line. Therefore you can also have several command line profiles, preferences, etc. Similarly to projects, you basically create this small virtual unit in your folder system, set up its environment to your needs and then reach its contents when you need it.
- fakechroot environment
You can go also another step further and use a fakechroot environment to install different package version, any other missing package, different Debian version or even a different Linux distribution for your tool. This is a little bit harder and also doesn't need to be stable or bug-free. You can easily install Gentoo or Debian this way and perhaps even more.
- compiling from source
Finally you can also usually download a source code of the package and compile it locally using:
$ ./configure --prefix=my_folder && make all install
Or download a precompiled Debian binary.