This is an old revision of the document!
Pkg Primer
Rosetta Stone
| Function | legacy pkg_* | pkgng |
|---|---|---|
| get list of installed packages | pkg_info | pkg info |
| get basic information about a package | pkg_info pkgname-pkgversion | pkg info pkgname OR pkg info category/name OR pkg info pkgname-pkgversion |
| get detailled information about a package | N/A | pkg info -f pkgname OR pkg info -f category/name OR pkg info -f pkgname-pkgversion |
| list all files contained in an installed package | pkg_info -L pkgname-pkgversion | pkg info -l pkgname OR pkg info -l category/name OR pkg info -l pkgname-pkgversion |
| find which package provide an installed file | pkg_info -W /path/to/my/file | pkg which /path/to/my/file |
| install a local package | pkg_add ./localpkg.tbz | pkg add ./localpkg.txz |
| install a remote package | pkg_add -r mypackage | pkg install mypackage OR pkg install category/name OR pkg install pkgname-pkgversion |
| search for a remote package | N/A | pkg search mypackage OR pkg search category/name OR pkg search pkgname-pkgversion |
| search for detailled informations about a remote package | N/A | pkg search -f mypackage OR pkg search -f category/name OR pkg search -f pkgname-pkgversion |
| show reverse dependencies of an installed package | pkg_info -R pkgname-pkgversion | pkg info -r mypackage OR pkg info -r category/name OR pkg info -r pkgname-pkgversion |
| show dependencies of an installed package | pkg_info -r pkgname-pkgversion | pkg info -d mypackage OR pkg info -d category/name OR pkg info -d pkgname-pkgversion |
| remove unused packages install as a dependency | N/A | pkg autoremove |
| binary upgrade the installed packages | N/A | pkg upgrade |
| create a remote repository | N/A | pkg repo /path/to/a/directory/containing/packages |
| manipulate packages in a jail | N/A | pkg -j <name_or_id_of_a_jail> <command> |
| manipulate packages in a chroot | pkg_add -C <path_to_chroot> (not all commands are chroot aware) | pkg -c <path_to_chroot> <command> |
| show information about installed packages using regular expression | pkg_info -x <regex> | pkg info -x <regex> |
| show information about installed packages using extended regular expression | pkg_info -X <regex> | pkg info -X <regex> |
| show information about installed packages using globbing | pkg_info <globbing> | pkg info -g <globbing> |
| check for known vulnerability | portaudit (third party tool) | pkg audit |
| show out of date packages (determine out of the ports tree) | pkg_version -l < | pkg version -l < |
| show out of date packages (determine out of the ports tree index) | pkg_version -Il < | pkg version -Il < |
| show out of date packages compared to a remote repository | N/A | pkg upgrade -n |