Introduction
FreeBSD's pkg(8) is a powerful, modern tool for managing packages. This page hopes to provide a resource through which you can translate your existing package management knowledge directly to FreeBSD.
This page is presently a work in progress.
Contents
- Introduction
- Traditional ports (FreeBSD, DragonFly)
- OpenBSD tools
- pkgsrc (NetBSD and others)
- apt-get / dpkg (Debian, Ubuntu, Mint)
- apt (Debian bases, Ubuntu, Mint, ...)
- yum / rpm (RHEL 7, CentOS 7)
- zypper / rpm (SuSE, OpenSuSE)
- dnf / rpm (Fedora)
- emerge (Gentoo)
- pacman (Arch)
- slackpkg / sbotools (Slackware)
- Solaris package tools
- Your system's tools...
- Notes
- To Do for this page:
Traditional ports (FreeBSD, DragonFly)
Task |
ports |
pkg |
Configuration files/dirs |
/etc/pkg/ |
|
Package database (local) |
/var/db/pkg/local.sqlite |
|
Package database (remote) |
/var/db/pkg/repo-*.sqlite |
|
Locally cached packages |
/usr/ports/Packages/All/ |
|
Update database (remote) |
portsnap fetch update |
pkg update |
Manual pages |
man 8 ports |
pkg help subcommand |
Search package |
make -C /usr/ports quicksearch name=pattern |
pkg search pattern (only by name) |
Install package |
make -C /usr/ports/category/port install clean |
pkg install packagename |
Delete single package |
make -C /usr/ports/category/port deinstall |
pkg delete -f packagename |
Delete package and dependencies |
pkg delete packagename |
|
List installed packages |
pkg info |
|
List files installed by a package |
pkg info -l packagename |
|
Upgrade single package with dependencies |
make -C /usr/ports/category/port build deinstall reinstall |
pkg upgrade packagename |
Upgrade all packages |
portmaster -a (ports/ports-mgmt/portmaster) |
pkg upgrade |
Delete automatically installed packages |
pkg autoremove |
|
Delete outdated cached packages |
portmaster --clean-distfiles (deletes distfiles) |
pkg clean |
Show repository stats |
pkg stats |
|
Find installed package by filename |
pkg which filepath |
|
Show vulnerable installed packages |
pkg audit -F |
|
Show special updating instructions |
less /usr/ports/UPDATING |
pkg updating |
OpenBSD tools
Task |
... |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
pkgsrc (NetBSD and others)
Task |
pkgsrc |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
apt-get / dpkg (Debian, Ubuntu, Mint)
Task |
apt-get / dpkg |
pkg |
Configuration files/dirs |
/etc/apt |
/etc/pkg/ |
Package database (local) |
/var/lib/dpkg/status |
/var/db/pkg/local.sqlite |
Package database (remote) |
/var/lib/apt/lists/* |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
/var/cache/apt/archives/*.deb |
/var/cache/pkg/*.pkg |
Update database (remote) |
apt-get update |
pkg update |
Manual pages |
apt-get(8), apt-cache(8), dpkg(1) |
pkg help subcommand |
Search package |
apt-cache search pattern |
pkg search pattern (only by name) |
Install package |
apt-get install packagename |
pkg install packagename |
Delete single package |
apt-get remove packagename |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
dpkg -l |
pkg info |
List files installed by a package |
dpkg -L packagename |
pkg info -l packagename |
Upgrade single package with dependencies |
apt-get install packagename |
pkg upgrade packagename |
Upgrade all packages |
apt-get dist-upgrade |
pkg upgrade |
Delete automatically installed packages |
apt-get autoremove |
pkg autoremove |
Delete outdated cached packages |
apt-get autoclean |
pkg clean |
Show repository stats |
pkg stats |
pkg stats |
Find installed package by filename |
dpkg -S filepath |
pkg which filepath |
Show vulnerable installed packages |
--- |
pkg audit -F |
Show special updating instructions |
--- |
pkg updating |
apt (Debian bases, Ubuntu, Mint, ...)
Task |
apt |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
yum / rpm (RHEL 7, CentOS 7)
Task |
yum / rpm |
pkg |
Configuration files/dirs |
/etc/yum.conf |
/etc/pkg/ |
Package database (local) |
/var/lib/rpm/ |
/var/db/pkg/local.sqlite |
Package database (remote) |
/var/cache/yum/arch/release/* |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
/var/cache/yum/arch/release/repo/packages/ |
/var/cache/pkg/*.pkg |
Update database (remote) |
yum makecache |
pkg update |
Manual pages |
man 8 yum |
pkg help subcommand |
Search package |
yum search pattern |
pkg search pattern (only by name) |
Install package |
yum install packagename |
pkg install packagename |
Delete single package |
yum remove packagename |
pkg delete -f packagename |
Delete package and dependencies |
yum autoremove packagename |
pkg delete packagename |
List installed packages |
rpm -qa |
pkg info |
List files installed by a package |
rpm -ql packagename |
pkg info -l packagename |
Upgrade single package with dependencies |
yum upgrade packagename |
pkg upgrade packagename |
Upgrade all packages |
yum update |
pkg upgrade |
Delete automatically installed packages |
yum autoremove |
pkg autoremove |
Delete outdated cached packages |
yum clean packages |
pkg clean |
Show repository stats |
yum history stats |
pkg stats |
Find installed package by filename |
rpm -qf filepath |
pkg which filepath |
Show vulnerable installed packages |
yum list-security |
pkg audit -F |
Show special updating instructions |
(no equivalent) |
pkg updating |
zypper / rpm (SuSE, OpenSuSE)
Task |
zypper / rpm |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
dnf / rpm (Fedora)
Task |
dnf / rpm |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
emerge (Gentoo)
Task |
emerge |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
pacman (Arch)
Task |
pacman |
pkg |
Configuration files/dirs |
/etc/pacman.d/ |
/etc/pkg/ |
Package database (local) |
/var/lib/pacman/local/ |
/var/db/pkg/local.sqlite |
Package database (remote) |
/var/lib/pacman/sync/ |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
/var/cache/pacman/pkg/ |
/var/cache/pkg/*.pkg |
Update database (remote) |
pacman -Sy |
pkg update |
Manual pages |
pacman operation --help |
pkg help subcommand |
Search package |
pacman -Ss pattern (remote) |
pkg search pattern (only by name) |
Install package |
pacman -S packagename |
pkg install packagename |
Delete single package |
pacman -R packagename |
pkg delete -f packagename |
Delete package and dependencies |
pacman -Rs packagename |
pkg delete packagename |
List installed packages |
pacman -Q |
pkg info |
List files installed by a package |
pacman -Ql packagename |
pkg info -l packagename |
Upgrade single package with dependencies |
pkg upgrade packagename |
|
Upgrade all packages |
pacman -Syu |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
pacman -Sc |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
pacman -Qo filepath |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
slackpkg / sbotools (Slackware)
Task |
slackpkg / sbotools |
pkg |
Configuration files/dirs |
/etc/slackpkg/* |
/etc/pkg/ |
Package database (local) |
/var/log/packages |
/var/db/pkg/local.sqlite |
Package database (remote) |
/var/lib/slackpkg/ |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
/var/cache/packages/ |
/var/cache/pkg/*.pkg |
Update database (remote) |
slackpkg update |
pkg update |
Manual pages |
man 8 slackpkg |
pkg help subcommand |
Search package |
sbofind pattern |
pkg search pattern (only by name) |
Install package |
sboinstall packagename |
pkg install packagename |
Delete single package |
removepkg packagename |
pkg delete -f packagename |
Delete package and dependencies |
sboremove packagename |
pkg delete packagename |
List installed packages |
ls /var/log/packages |
pkg info |
List files installed by a package |
cat /var/log/packages/packagename |
pkg info -l packagename |
Upgrade single package with dependencies |
sboupgrade packagename |
pkg upgrade packagename |
Upgrade all packages |
slackpkg upgrade ; slackpkg install-new ; slackpkg upgrade-all |
pkg upgrade |
Delete automatically installed packages |
no equivalent |
pkg autoremove |
Delete outdated cached packages |
no equivalent |
pkg clean |
Show repository stats |
no equivalent |
pkg stats |
Find installed package by filename |
grep filepath /var/log/packages/* |
pkg which filepath |
Show vulnerable installed packages |
no equivalent |
pkg audit -F |
Show special updating instructions |
no equvialent |
pkg updating |
Solaris package tools
Task |
pkgadd etc. |
pkg |
Configuration files/dirs |
... |
/etc/pkg/ |
Package database (local) |
... |
/var/db/pkg/local.sqlite |
Package database (remote) |
... |
/var/db/pkg/repo-*.sqlite |
Locally cached packages |
... |
/var/cache/pkg/*.pkg |
Update database (remote) |
... |
pkg update |
Manual pages |
... |
pkg help subcommand |
Search package |
... |
pkg search pattern (only by name) |
Install package |
... |
pkg install packagename |
Delete single package |
... |
pkg delete -f packagename |
Delete package and dependencies |
... |
pkg delete packagename |
List installed packages |
... |
pkg info |
List files installed by a package |
... |
pkg info -l packagename |
Upgrade single package with dependencies |
... |
pkg upgrade packagename |
Upgrade all packages |
... |
pkg upgrade |
Delete automatically installed packages |
... |
pkg autoremove |
Delete outdated cached packages |
... |
pkg clean |
Show repository stats |
... |
pkg stats |
Find installed package by filename |
... |
pkg which filepath |
Show vulnerable installed packages |
... |
pkg audit -F |
Show special updating instructions |
... |
pkg updating |
Your system's tools...
Tell us what we're missing!
Notes
Unlike some other package managers, FreeBSD's pkg does not handle starting and stopping of services when packages are installed or deleted. You have to use "service rcscript <start|stop|restart>" manually. To restart all enabled services installed from ports use "service -R"
To Do for this page:
- Note rc.conf, and more generally, service start syntax and requirements per system.
- Note FreeBSD distinctions: pkg, ports, base
- Note how to mix ports and packages, and note port tree branching. Discuss Poudriere.
- Note svn for updates, not just portsnap
- Note freebsd-update, since this is a package operation elsewhere