FreeBSD -- pkg tips and tricks

This commit is contained in:
Petr Velycko 2025-06-12 10:38:02 +02:00
parent 387420d750
commit 6f08e0850d
Signed by: petrvel
GPG key ID: E8F909AFE649174F

View file

@ -65,3 +65,32 @@ Since FreeBSD 14, FreeBSD has excellent support for Wireguard VPNs. I just had t
wireguard_enable="YES"
wireguard_interfaces="wg0"
```
# `pkg` package manager
During my adventures I stumbled upon some useful commands for the builtin `pkg` package manager that I feel like could be useful to others.
Reinstall all packages from the repository (in case you want to sync your system state to the repositories, including downgrading packages if needed, similar to Arch's `pacman -Suu`):
```
pkg upgrade -f
```
Show packages that depend on the given package (reverse dependencies):
```
pkg info -r PACKAGE
```
Show dependencies of a given package:
```
pkg info -d PACKAGE
```
Install a package from a given repository:
```
pkg install -r REPOSITORY PACKAGE
```
Update the system from a given repository:
```
pkg upgrade -r REPOSTIORY
```