From Lazarus wiki
Revision as of 10:45, 26 April 2010 by Loesje (talk | contribs) (Basics)


Fppkg is the freepascal package manager. This tool manages packages from a repository, unzips, builds and installs.

See also FPMake.


Quick-start guide

Note: this section is only valid for fppkg from fpc version 2.5.1 or higher.

Setting up

When you run fppkg for the first time, it will create new configuration files with the default values. To check if these values are ok, run 'fppkg list'. You should see something like below.

Name                 Installed    Available   
a52                  2.5.1-1      -           
aspell               2.5.1-1      -           
bfd                  2.5.1-1      -           
lnet                 -            0.6.3-0  

If fppkg does not show any installed packages, you have to adapt the path to your fpc-installation in the default compiler configuration file.

By default this file is named '~/.fppkg/config/default' on Unix/Linux/Posix and '%appdata%\fpc\fppkg\config\default' on windows systems. If you have found this file, open it in your favourite text editor and change the 'GlobalInstallDir' to the location where fpc is installed. For example: 'GlobalInstallDir=/home/joost/fpc-trunk/lib/fpc/2.5.1/'. Save the file and run 'fppkg list' again.

If you have still problems please read the section about configuring fppkg.

Installing a package

Installing a package is as simple as 'fppkg install [packagename]'. This will download, compile and install the package. When no error appears, use 'fppkg list' to check if the package is correctly installed. By default the package is installed for the current user only, if you want to force a system-wide installation, use the '-g' parameter. Note however that in that case you need to have the proper rights.

Configuring the compiler

As a last step, the freepascal-compiler has to find the installed packages. By default the packages are installed in a user-specific location and this location is by default not searched by the compiler. To add it, add the following line to your fpc.cfg:

Linux: (/etc/fpc.cfg or ~/.fpc.cfg)


Windows: (fpc.cfg)


Now you can use the units from the installed packages in all your programs

Commandline arguments

Output of fppkg -h

Usage: .../fppkg [options] <action> <package>
  -c --config        Set compiler configuration to use
  -h --help          This help
  -v --verbose       Show more information
  -d --debug         Show debugging information
  -g --global        Force installation to global (system-wide) directory
  -f --force         Force installation also if the package is already installed
  -r --recovery      Recovery mode, use always internal fpmkunit
  update             Update packages list
  list               List available and installed packages
  build              Build package
  compile            Compile package
  install            Install package
  clean              Clean package
  archive            Create archive of package
  download           Download package
  convertmk          Convert Makefile.fpc to fpmake.pp



Update packages list


List available and installed packages


Build package


Install package


Download package


Convert Makefile.fpc to fpmake.pp