Introduction to the Package Manager

Authors
Affiliations

Felix Cremer

Max Planck Institute for Biogeochemistry

Lazaro Alonso

Max Planck Institute for Biogeochemistry

Anshul Singhvi

JuliaHub

Fabian Gans

Max Planck Institute for Biogeochemistry

This is only a small glimpse into the Julia package manager. For an in depth intro see Pkg.jl and Julia Environments for Beginners.

0.1 Essentials

  • add PackageName - Install a package
  • rm PackageName - Remove a package
  • up or update - Update all packages
  • resolve - Determine versions of all packages specified in Project.toml and Manifest.toml`
  • instantiate - Install all packages from Project.toml
  • st or status - Show installed packages
  • activate . - Activate environment in current directory
  • ? - Get help

1 REPL package manager mode

There are two ways to interact with the package manager. Either programmatically by loading it in via using Pkg or by switching to the pkg mode in the REPL. Here we will use the REPL mode. To switch to the pkg mode use the closing square bracket.

]

This will switch the prompt of your REPL and now you can do package management tasks.

Note

From now on we will assume you are in the pkg REPL mode

  • get some help
? # help

1.1 Activating your environment

  • Activate your
activate .
# You can use any path that is on your computer
  • See what is installed
st # status
  • Download all installed packages
instantiate

1.2 Package handling

  • Add a package
add Example
  • Remove a package
rm Example
  • Update packages
up
up PackageName

1.2.1 Further reading

For a more in depth introduction and more tips and tricks see the REPL Mastery workshop from JuliaCon 2022.