HowTo: Build the Linux Kernel Runtime Guard (LKRG) Debian Package from Source Code

From Whonix

< Linux Kernel Runtime Guard LKRG
LKRG logo

These are instructions on how to build the LKRG Debian Package from source code while verifying software signatures for better security. If these instructions look a bit daunting and if you never before verified software signatures, you could alternativly have a look at these simpler instructions here.

Get Build Dependencies[edit]

Update your package lists.

sudo apt-get update

Install from Debian repository.

sudo apt-get install build-essential devscripts git

Get the Signing Key[edit]

Get the Signing Key

This chapter is recommended for better security, but it is not strictly required. (See Trust)

1. Download Patrick Schleizer (adrelanos) OpenPGP key. patrick.asc

Note: If Whonix is already being used, this process can be simplified. See the footnotes. [1]

2. Store it as patrick.asc.

3. Import the key.

gpg --import patrick.asc

4. Verify the key using this fingerprint.

gpg --fingerprint 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA

The output should show.

pub   rsa4096 2014-01-16 [SC] [expires: 2021-04-17]
      916B 8D99 C38E AF5E 8ADC  7A2A 8D66 066A 2EEA CCDA
uid           [  full  ] Patrick Schleizer <>
sub   rsa4096 2014-01-16 [E] [expires: 2021-04-17]
sub   rsa4096 2014-01-16 [A] [expires: 2021-04-17]
sub   rsa4096 2014-01-16 [S] [expires: 2021-04-17]

5. This only retrieves the signing key from one source. For better security, learn more about the Whonix Signing Key.

Change Directory to Build Folder[edit]

This chapter is recommended for better usability, but is not strictly required. [2]

Create folder ~/lkrg-build.

mkdir -p ~/lkrg-build

Change directory to folder ~/lkrg-build.

cd ~/lkrg-build

Get the Source Code[edit]

Get the the package's source code.

git clone

Remember it is Whonix, not whonix! If you are prompted for a username for github, it means you have mistyped the web address.

Change Directory to Source Code Folder[edit]

Get into the package's source code folder because later on package build commands are expected to be run from the root of the source folder.

cd lkrg

OpenPGP Verify the Source Code[edit]

OpenPGP Verify the Source Code

This chapter is recommended for better security, but is not strictly required.[3]

Retrieve a list of available git tags.

git --no-pager tag

Verify the tag you want to build. Replace it with the tag chosen to build.

git tag -v 0.7.1-1

The output should look similar to this.

object 1844108109a5f2f8bddcf2257b9f3675be5cfb22
type commit
tag {{{version}}}
tagger Patrick Schleizer <> 1392320095 +0000

gpg: Signature made Thu 13 Feb 2014 07:34:55 PM UTC using RSA key ID 77BB3C48
gpg: Good signature from "Patrick Schleizer <>" [ultimate]

The warning.

gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.

Is explained on the Whonix Signing Key page and can be safely ignored.

Choose Version[edit]

Retrieve a list of available git tags.

git --no-pager tag

Use git checkout to select the preferred version to build.

git checkout  0.7.1-1

Replace 0.7.1-1 with the actual version chosen for the build: the stable, testers-only or developers version. Common sense is required when choosing the right version number. For example, the latest available version number is not necessarily the most stable or suitable. Follow the Whonix ™ News Blog as it might contain information.

Check if you really got the version you want.

git describe

Should show:


Check if source folder is pristine.

git status

Should show nothing.

HEAD detached at 0.7.1-1
nothing to commit, working tree clean

If it shows something else, do not continue.

Build the Package[edit]

dpkg-buildpackage -b

Build Result[edit]

When a package is build using dpkg-buildpackage the resulting packages will be created in the parent folder. I.e. in this case in the ~/lkrg-build folder.

ls ../

Should show something like this.

lkrg lkrg_0.7.1-1-1_amd64.buildinfo lkrg_0.7.1-1-1_amd64.changes lkrg-dkms_0.7.1-1-1_amd64.deb


sudo dpkg -i ../lkrg-dkms_0.7.1-1-1_amd64.deb

Clean Up[edit]

Clean up temporary files debhelper files in package source folder. Show files to remove.

git clean -ffdn

Clean up temporary files debhelper files in package source folder. Actually remove.

git clean -ffd

Remove .deb file etc. in parent folder.

TODO: document

Credits and Source Code[edit]

The original [archive] source software is maintained by Adam "pi3" Zabrocki. See also authorship

This website with Debian package build instructions and LKRG Debian Package Website is the software fork [archive] homepage for LKRG, with a focus on easy installation, added user documentation, and integration with Whonix, Kicksecure, Debian, and other distributions. The software fork source code can be found here [archive].


  1. Steps 1-3 can be completed with just one command.
    gpg --import /usr/share/whonix/whonix-keys.d/patrick.asc

  2. When a package is build using dpkg-buildpackage the resulting packages will be created in the parent folder. It's better for usability if this is not the user's home folder since many other files may already reside there. Thereby making the build result files more difficult to find or delete. This is a missing Debian feature. See: dpkg-buildpackage: support output directory other than .. [archive]
  3. See Trust.

text=Jobs in USA
Jobs in USA

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki

Follow: 1024px-Telegram 2019 Logo.svg.png Iconfinder Apple Mail 2697658.png Twitter.png Facebook.png Rss.png Reddit.jpg 200px-Mastodon Logotype (Simple).svg.png

Support: 1024px-Telegram 2019 Logo.svg.png Discourse logo.png Matrix logo.svg.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

Whonix donate bitcoin.png Monero donate Whonix.png United Federation of Planets 1000px.png

Share: Twitter | Facebook

https link onion link

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.

Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].

Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint, Contact.