---
title: pun update
description: Update dependencies.
---

Update every package, or only the ones named, then install them. The lock matches `composer update`.

## Usage

```bash
pun update [packages] [options]
```

```bash
pun update
pun update laravel/framework
pun update 'symfony/*' --with-dependencies
pun update --dry-run
```

## Options

| Option | Description |
| --- | --- |
| `-w`, `--with-dependencies` | Also update their dependencies. |
| `-W`, `--with-all-dependencies` | Also update their dependencies, including your own requirements. |
| `-m`, `--minimal-changes` | Keep other packages at their locked version where possible. |
| `--prefer-lowest` | Pick the lowest allowed versions. |
| `--prefer-stable` | Prefer stable versions. |
| `--dry-run` | Show the changes, write nothing. |
| `--no-install` | Write the lock, leave `vendor/` alone. |

Update also takes every [`pun install`](/docs/commands/install#options) option.

## What happens

- Reads Packagist and the `composer`, `package` and `path` repositories in `composer.json`.
- Picks the newest versions that fit `composer.json` and this PHP.
- Writes `composer.lock`, then runs `pun install`.
- Runs `pre-update-cmd` and `post-update-cmd`.
- If requirements clash, lists the conflicts and writes nothing.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Updated, or nothing to change. |
| 2 | No `composer.json`, requirements that clash, or a failed install. |
