|
| 1 | +# Updating an existing installation |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Pull the latest changes of the `development` repository and apply any new shell aliases to your `~/.bash_profile`. |
| 6 | +Aliases such as `node24` are written to `~/.bash_profile` only when the environment is first provisioned, so an existing installation does not receive them automatically. |
| 7 | + |
| 8 | +## General procedure |
| 9 | + |
| 10 | +Follow these steps whenever a new release of this repository introduces changes that affect an installation you have already provisioned. |
| 11 | + |
| 12 | +Connect to your **AlmaLinux 10** distro, then go to the directory where you cloned the repository (by default `~/development`) and pull the latest changes: |
| 13 | + |
| 14 | +```shell |
| 15 | +cd ~/development |
| 16 | +git pull |
| 17 | +``` |
| 18 | + |
| 19 | +Open the template that defines the shell aliases and compare it with your own `~/.bash_profile`: |
| 20 | + |
| 21 | +```shell |
| 22 | +cat wsl/roles/system/templates/bash_profile.j2 |
| 23 | +``` |
| 24 | + |
| 25 | +Open `~/.bash_profile` in an editor and add any alias that is missing from it: |
| 26 | + |
| 27 | +```shell |
| 28 | +nano ~/.bash_profile |
| 29 | +``` |
| 30 | + |
| 31 | +Save the file, then log out and log back in (or run `source ~/.bash_profile`) so that the new aliases are loaded. |
| 32 | + |
| 33 | +> Only add what is new. |
| 34 | +> Do not replace the whole file, as it may contain your own customizations. |
| 35 | +
|
| 36 | +## Changes |
| 37 | + |
| 38 | +### Node.js 24 by default |
| 39 | + |
| 40 | +Node.js 24 is now the default version, and the `node24` alias is available. |
| 41 | +To upgrade an existing installation: |
| 42 | + |
| 43 | +1. Go to your clone of the repository and pull the latest changes: |
| 44 | + |
| 45 | + ```shell |
| 46 | + cd ~/development |
| 47 | + git pull |
| 48 | + ``` |
| 49 | + |
| 50 | +2. Open `~/.bash_profile`: |
| 51 | + |
| 52 | + ```shell |
| 53 | + nano ~/.bash_profile |
| 54 | + ``` |
| 55 | + |
| 56 | +3. Add the following line: |
| 57 | + |
| 58 | + ```shell |
| 59 | + alias node24="sudo dnf remove nodejs -y && curl -fsSL https://rpm.nodesource.com/setup_24.x | sudo bash - && sudo dnf install nodejs -y" |
| 60 | + ``` |
| 61 | + |
| 62 | +4. Save the file, then log out and log back in. |
| 63 | +5. Run the alias to switch to Node.js 24: |
| 64 | + |
| 65 | + ```shell |
| 66 | + node24 |
| 67 | + ``` |
| 68 | + |
| 69 | +6. Check the installed version: |
| 70 | + |
| 71 | + ```shell |
| 72 | + node -v |
| 73 | + ``` |
| 74 | + |
| 75 | + The output should look similar to the below: |
| 76 | + |
| 77 | + ```terminaloutput |
| 78 | + v24.13.0 |
| 79 | + ``` |
| 80 | + |
| 81 | +For more on switching between Node.js versions, see the [FAQ](faq.md#how-do-i-switch-to-a-different-version-of-nodejs). |
0 commit comments