Package Construction Using fpm
Learn how to create a package using fpm.
We'll cover the following
Example package creation
Let’s say we want to create a Debian package for the npm
module leftpad
. We’d run the following commands:
$ sudo apt install npm
$ fpm -s npm -t deb leftpad
-
With
-s
, we specify the source, herenpm
. -
With
-t deb
, we instructfpm
to create a Debian package as the target. -
Finally,
leftpad
is the name of the source package, whichfpm
downloads (through thenpm
executable) and packages into a Debian package.
Our node-leftpad_0.0.1_amd64.deb
package is created successfully with the following message:
Created package {:path=>"node-leftpad_0.0.1_amd64.deb"}
fpm
knows the Debian convention of prepending node-
to the npm
package
name to create a Debian package name.
Installing a package
Let’s install the package we created and explore it a bit. These commands can be tried out in the playground below.
$ sudo dpkg -i node-leftpad_0.0.1_amd64.deb
The following output would indicate that our package is installed successfully:
Get hands-on with 1200+ tech skills courses.