Actions

Upgrading Whonix ™ Deb Packages from Source Code

From Whonix

< Dev‎ | Build Documentation




Introduction[edit]

This assumes you are updating Whonix ™ debian packages while you are using Whonix ™.

Prerequisites[edit]

Might be a good idea to create a backup and/or clone before trying to update.

If you haven't done already, disable Whonix ™ APT repository. [1]

sudo repository-dist --disable

Upgrade from Debian packages.

sudo apt update && sudo apt --yes full-upgrade

Get the Source Code[edit]

Get the Signing Key[edit]

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

Get the Whonix ™ Signing Key.

Get the Source Code[edit]

FREE

Ambox warning pn.svg.png Note: By proceeding, you acknowledge that you have read, understood and agreed to our Terms of Service and License Agreement. Ambox warning pn.svg.png

Install git.

sudo apt update && sudo apt install git

Get the source code including git submodules. [2] [3]

Note: Replace 16.0.3.7-stable with the actual tag you want to build.

git clone --depth=1 --branch 16.0.3.7-stable --jobs=4 --recurse-submodules --shallow-submodules https://gitlab.com/whonix/Whonix.git

Change Directory[edit]

Get into the Whonix source code folder because later on package build commands using ./whonix_build are expected to be run from the root of the source folder.

cd Whonix

OpenPGP Verify the Source Code[edit]

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

Git fetch. [5]

git fetch

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

Note: Replace 16.0.3.7-stable with the actual tag you want to build.

git verify-tag 16.0.3.7-stable

The output should look similar to this.

object 1844108109a5f2f8bddcf2257b9f3675be5cfb22

type commit tag 16.0.3.7 tagger Patrick Schleizer <adrelanos@whonix.org> 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 <adrelanos@whonix.org>" [ultimate]

warning Check the GPG signature timestamp makes sense. For example, if you previously saw a signature from 2021 and now see a signature from 2020, then this might be a targeted rollback (downgrade) or indefinite freeze attack. [6]

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.

By convention, git tags should point to signed git commits. [7] (forum discussion [archive]) It is advisable to verify the signature of the git commit as well (replace 16.0.3.7 with the actual git tag being verified).

git verify-commit 16.0.3.7-stable^{commit}

The output should look similar to this.

commit 5aa1c307c943be60e7d2bfa5727fa5ada3a79c4a

gpg: Signature made Sun 07 Dec 2014 01:22:22 AM UTC using RSA key ID 77BB3C48 gpg: Good signature from "Patrick Schleizer <adrelanos@whonix.org>" [ultimate] Author: Patrick Schleizer <adrelanos@whonix.org> Date: Sun Dec 7 01:22:22 2014 +0000

.

Choose Version[edit]

Retrieve a list of available git tags.

git --no-pager tag

Use git checkout to select the preferred version to build.

Note: Replace 16.0.3.7-stable with the actual tag you want to build.

git checkout --recurse-submodules 16.0.3.7-stable

Check Git[edit]

Check if you really got the version you want.

git describe

The output should show.

{{{version}}}

Check if the source folder is pristine.

git status

The output should show nothing.

HEAD detached at {{{version}}}
nothing to commit, working tree clean

If it shows something else, do not continue.

Build Dependencies[edit]

Get all build dependencies.

sudo -E ./build-steps.d/1100_prepare-build-machine --internalrun --build --target root

Why --target root? This is correct, if you want to know why, see footnote. [8]

Create the Packages[edit]

If you're not debugging, create the packages with:

sudo -E ./build-steps.d/1200_create-debian-packages --build --internalrun --target root

If debugging, use the following command. Developers only! [9] Potentially insecure unless the untagged / uncommited changes are by you or by a trusted developer with a git gpg signature that you verified.

sudo -E ./build-steps.d/1200_create-debian-packages --build --allow-untagged true --allow-uncommitted true --internalrun --target root

Upgrade Whonix ™ Debian Packages[edit]

Upgrade Whonix ™ Debian Packages without contacting a Whonix ™ APT Repository, using your own locally created apt package repository.

For Whonix-Gateway ™.

sudo ./packages/whonix-developer-meta-files/debug-steps/locally-upgrade-whonix-debian-packages --build --target root --flavor whonix-gateway

[10]

For Whonix-Workstation ™.

sudo ./packages/whonix-developer-meta-files/debug-steps/locally-upgrade-whonix-debian-packages --build --target root --flavor whonix-workstation

There will be a lot debug output. [11]

If everything went well, you will see [12] [13]

########################################################################
## INFO: Successfully configured (postinst script) Whonix-Workstation ™. #
########################################################################

The last few highlighted messages will be similar to:

+ true 'INFO: Skipping script, because --target root: /home/user/whonix_dot/Whonix/help-steps/unmount-img'
+ true 'INFO: End of: ./debug-steps/locally-upgrade-whonix-debian-packages | exit_code: 0 | error(s) detected: 0 | benchmark: 00:01:40'

In case any error is caught, the script will loudly complain by echoing in a red colored error message:

ERROR in ./debug-steps/locally-upgrade-whonix-debian-packages! Aborted.

Lets hope it works well. Please get in Contact should there be any issues. Leave feedback if you are using this, if it worked for you, which issues you may have had, so these instructions can be updated.

Cleanup[edit]

Info This step is optional.

Remove temporary files.

Warning: This command will run git clean -d --force --force in Whonix's main source code folder [archive] (~/Whonix) as well as in all subfolders of the Whonix packages folder [archive] (~/Whonix/packages). This means if any files were purposefully added to any of these folders that have not been committed to git, these will be deleted. [14]

./help-steps/cleanup-files


See Also[edit]

Footnotes[edit]

  1. Project-APT-Repository#Disable_Whonix ™_APT_Repository
  2. Optional git parameters:
    • --depth=1: Used to speed up download.
    • --branch 16.0.3.7-stable Usability. Used to speed up download.
    • --jobs=4: Used to speed up download.
    • --recurse-submodules --shallow-submodules: Usability.
    Knowledgeable git users are free to drop any of these optional parameters.
  3. Alternatively, this can be achieved with the following commands in several steps. This is useful if network issues arise.
    git clone --depth=1 --branch 16.0.3.7-stable https://gitlab.com/whonix/Whonix.git

    cd Whonix

    git submodule update --init --recursive --progress --jobs=4

  4. See Trust.
  5. Optional. [...]
  6. As defined by TUF: Attacks and Weaknesses:
  7. Beginning from git tag 9.6 and above.
  8. Setting the --target parameter to root will result in installing fewer build dependencies. For example VirtualBox will not be installed. These are only required to build full images, but since we just want to create updated Whonix ™ Debian Packages, this is unnecessary. Not much harm done when forgetting to use --target root, because the user is free to remove any build dependencies later.
  9. Packages are possibly not matching the quality for redistributable testes or stable builds. This is because the package will potentially built from git master, which has no proper debian/changelog release version, and no signed git tag. There may be another package of that version in the repository that is different. Distinguishing these packages is hard and would cause confusion. Therefore this is considered unclean and only developers may do this for debugging purposes.
  10. Why use --target root"? Technical explanation: --target root in context of Whonix ™ source code means "do it on the system currently running, i.e. do it directly on the root folder "/[...]", don't do it inside "vm_image/[...]".
  11. Unless you log in as root and run export WHONIX_DEB_DEBUG=0.
  12. Or saying Whonix-Gateway ™ respectively
  13. It won't, if you have export WHONIX_DEB_DEBUG=0 set.
  14. https://github.com/Whonix/Whonix/blob/master/help-steps/cleanup-files [archive]


Fosshost is sponsors Kicksecure ™ stage server 100px
Fosshost About Advertisements

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: Discourse logo.png

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

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

Twitter-share-button.png Facebook-share-button.png Telegram-share.png link=mailto:?subject=Dev/Build Documentation/Upgrading Derivative Deb Packages from Source Code&body=../../Dev/Build_Documentation/Upgrading_Derivative_Deb_Packages_from_Source_Code link=https://reddit.com/submit?url=../../Dev/Build_Documentation/Upgrading_Derivative_Deb_Packages_from_Source_Code&title=Dev/Build Documentation/Upgrading Derivative Deb Packages from Source Code link=https://news.ycombinator.com/submitlink?u=../../Dev/Build_Documentation/Upgrading_Derivative_Deb_Packages_from_Source_Code&t=Dev/Build Documentation/Upgrading Derivative Deb Packages from Source Code link=https://mastodon.technology/share?message=Dev/Build Documentation/Upgrading Derivative Deb Packages from Source Code%20../../Dev/Build_Documentation/Upgrading_Derivative_Deb_Packages_from_Source_Code&t=Dev/Build Documentation/Upgrading Derivative Deb Packages from Source Code

Please consider a recurring donation! Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

https link onion link Priority Support | Investors | Professional Support

Whonix | © ENCRYPTED SUPPORT LP | Heckert gnu.big.png Freedom Software / Osi standard logo 0.png Open Source (Why?)

The personal opinions of moderators or contributors to the Whonix ™ project do not represent the project as a whole.

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.