diff --git a/tools/make_linux_package.sh b/tools/make_linux_package.sh
index aea1c567e88ee9a41493b06933c67fda88db6a89..0bcba7d3b0ac160141612c6ad2251d34d2ad6058 100755
--- a/tools/make_linux_package.sh
+++ b/tools/make_linux_package.sh
@@ -3,6 +3,8 @@
 # Run this script in the top nanopb directory to create a binary package
 # for Linux users.
 
+# Requires: protobuf, python-protobuf, pyinstaller
+
 set -e
 set -x
 
@@ -18,15 +20,15 @@ git archive HEAD | tar x -C $DEST
 # Rebuild the Python .proto files
 make -BC $DEST/generator/proto
 
-# Make the nanopb generator available as a protoc plugin
-cp $DEST/generator/nanopb_generator.py $DEST/generator/protoc-gen-nanopb.py
-
 # Package the Python libraries
-( cd $DEST/generator; bbfreeze nanopb_generator.py protoc-gen-nanopb.py )
-mv $DEST/generator/dist $DEST/generator-bin
+( cd $DEST/generator; pyinstaller nanopb_generator.py )
+mv $DEST/generator/dist/nanopb_generator $DEST/generator-bin
 
-# Remove temp file
-rm $DEST/generator/protoc-gen-nanopb.py
+# Remove temp files
+rm -rf $DEST/generator/dist $DEST/generator/build $DEST/generator/nanopb_generator.spec
+
+# Make the nanopb generator available as a protoc plugin
+cp $DEST/generator-bin/nanopb_generator $DEST/generator-bin/protoc-gen-nanopb
 
 # Package the protoc compiler
 cp `which protoc` $DEST/generator-bin/protoc.bin