Update Command
frg update replaces your frg binary with a newer published release. Use it to upgrade in place instead of reinstalling. The same update path is used when auto_update is enabled.
Prerequisites
- Network access to GitHub Releases.
- Write access to the directory that contains the
frgbinary. - No license or coding agent is required.
Subcommands at a glance
frg update has no subcommands. Its behavior is controlled by options and by the [update_check] configuration section.
| Setting or option | What it does | Default |
|---|---|---|
frg update | Installs the newest release that matches your settings | Newest stable release |
[update_check] include_prerelease | Lets "newest release" include pre-releases | Not set (stable only) |
[update_check] auto_update | Installs available updates automatically after a command completes | Not set (notify only) |
FORGE_NO_UPDATE_CHECK | Disables update checks | Not set |
See Update Check Configuration for the full description of these settings.
Typical flow
update notice (stderr) ──► frg update ──► download to staging file ──► verify ──► atomic swap ──► frg --version
- Forge prints a notice on stderr when a newer release is available.
- Upgrade:
frg update
- Confirm the new version:
frg --version
- Optionally, opt in to automatic updates or pre-releases in your configuration:
[update_check]
auto_update = true
include_prerelease = true
frg update
frg update [OPTIONS]
| Option | Description |
|---|---|
--version <VERSION> | Installs a specific published version, regardless of include_prerelease. |
--force | Reinstalls even if the installed version is current. |
frg update
frg update --version <version>
How it works
The self-update library has these properties:
- The release asset is downloaded to a staged file next to the current binary, created exclusively so that concurrent runs cannot share it.
- The staged binary replaces the current one in an atomic stage-and-swap, so an interrupted update does not leave a partial binary.
- Artifact cleanup keeps the active staged binary.
- With
auto_updateenabled, updates run after your command completes and take effect on the next command. - The update notice is throttled, and suppressed update checks are not cached.
Package manager installations
If a package manager installed frg, upgrade through that package manager:
| Installed via | Upgrade with |
|---|---|
| Install script or standalone binary | frg update |
.deb (apt) | sudo apt update && sudo apt install --only-upgrade frg |
.rpm (dnf) | sudo dnf upgrade frg |
Permissions
If the install directory (by default /usr/local/bin) is not writable by your user, run sudo frg update. Alternatively, reinstall to a directory you own with the install script's --install-dir option:
curl -fsSL https://github.com/telerik/forge/releases/latest/download/install.sh | sh -s -- --install-dir ~/.local/bin
--install-dir is an option of install.sh, not of frg update.
Exit codes
| Code | Meaning |
|---|---|
0 | The update succeeded, or the installed version is already current. |
| Non-zero | The update failed; the previous installation is unchanged. |
Troubleshooting
error: unrecognized subcommand 'update'
Cause: The frg binary on your PATH is older than the installed release.
Solution:
- Check your version with
frg --version. - Upgrade with the installer or your package manager. See Installation: Upgrading.
Permission denied
Cause: The directory that contains frg is not writable by the current user.
Solution:
- Run
sudo frg update, or - Reinstall to a user-writable directory with
install.sh --install-dir(see Permissions).
The update fails verification or download
Cause: The download was incomplete or corrupted, or GitHub rate-limited the request.
Solution:
- Wait a few minutes and run
frg updateagain. - If it keeps failing, download the release from GitHub Releases, verify it with
gpg --verify <artifact>.asc <artifact>, and install it manually.
See Also
- Update Check Configuration:
auto_update,include_prerelease, and the update notice. - Utility Commands.