Jump to: navigation, search

Dev/Build Documentation/8 deb


UNFINISHED!

Upgrading Whonix Deb Packages from Source Code[edit]

Introduction[edit]

This assumes you are updating Whonix's 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's APT repository. [1]

sudo whonix_repository --disable

Upgrade from Debian packages.

sudo apt-get update && sudo apt-get --yes dist-upgrade


Get the Signing Key[edit]

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

Download the key.

curl --tlsv1 --proto =https -o patrick.asc https://www.whonix.org/patrick.asc

Check fingerprints/owners without importing anything.

gpg --with-fingerprint patrick.asc

Verify it shows the following.

pub  4096R/2EEACCDA 2014-01-16 Patrick Schleizer <adrelanos@riseup.net>
      Key fingerprint = 916B 8D99 C38E AF5E 8ADC  7A2A 8D66 066A 2EEA CCDA
sub  4096R/CE998547 2014-01-16 [expires: 2016-10-05]
sub  4096R/119B3FD6 2014-01-16 [expires: 2016-10-05]
sub  4096R/77BB3C48 2014-01-16 [expires: 2016-10-05]

If it checks out, import the key.

gpg --import patrick.asc

Only getting the signing key from one source, from the download you want to verify isn't safe. For better security, Learn about Whonix Signing Key.

Get the Source Code[edit]

Install git and curl

sudo apt-get install git curl

Get source code including git submodules.

git clone --recursive https://github.com/Whonix/Whonix

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

Get into the source folder.

cd Whonix

(For experimental, faster, alternative method, see footnote. [2])

OpenPGP Verify the Source Code[edit]

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

Get a list of available git tags.

git tag

Verify the tag you want to build.

## ... Replace with tag you want to build.
git verify-tag 13.0.0.1.1-stable

Output should look similar to this.

object 1844108109a5f2f8bddcf2257b9f3675be5cfb22
type commit
tag 13.0.0.1.1
tagger Patrick Schleizer <adrelanos@riseup.net> 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@riseup.net>" [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 ignored.

By convention, git tags should point to signed git commits. [5] (forum discussion) It is recommended to verify the signature of the git commit as well. (Replace 13.0.0.1.1 with the actual git tag you want to verify.)

git verify-commit 13.0.0.1.1-stable^{commit}

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@riseup.net>" [ultimate]
Author: Patrick Schleizer <adrelanos@riseup.net>
Date:   Sun Dec 7 01:22:22 2014 +0000

    .

Choose Version[edit]

Git checkout, which version (or git branch) you want to build.

In case you want to build a specific git tag.

git checkout 13.0.0.1.1-stable

You have to replace 13.0.0.1.1 with the actual version you want to build. The stable version, the testers-only version or the developers version. Common sense is required while choosing the right version number. For example, the biggest version number is not necessarily the most recommended / latest stable version. You can learn about current versions reading Whonix News Blogs. New versions are also announced on the whonix-devel mailing list. So you could alternatively check its archives. Signing up for whonix-devel is another way to get informed about new releases.

Clean up and Sanitize[edit]

This is also important for security.

Get a list of eventually extraneous files and folders. [6]

git clean -ndff

And look if that looks sane. (Generally should, unless you are modifying Whonix's source code, then you should understand git a bit better and know what you are doing.) If it looks like the following, everything is fine.

Would remove packages/apparmor-profile-gwenview/
Would remove packages/kde-privacy/

Now get rid of these folders.

git clean -dff

Should show.

Removing packages/apparmor-profile-gwenview/
Removing packages/kde-privacy/

Make sure you have checked out the right commit for each git submodule.

git submodule update --init --recursive

Check if there are no extraneous files. This is important for security.

git status

Should only show and nothing else.

# Not currently on any branch.
nothing to commit (working directory clean)

Otherwise we'd need to get rid of these files first.


Build Dependencies[edit]

Get all build dependencies.

sudo ./build-steps.d/1100_prepare-build-machine --bare-metal

Why --bare-metal? This is correct, if you want to know why, see footnote. [7]

Create the Packages[edit]

sudo ./build-steps.d/1200_create-debian-packages

Upgrade Whonix Debian Packages[edit]

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

For Whonix-Gateway.

sudo ./debug-steps/locally-upgrade-whonix-debian-packages --bare-metal --tor-gateway

[8]

For Whonix-Workstation.

sudo ./debug-steps/locally-upgrade-whonix-debian-packages --bare-metal --tor-workstation

There will be a lot debug output. [9]

If everything went well, you will see [10] [11]

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

Last message will probably[12] be:

+ true 'INFO: Skipping script, because BARE_METAL=1: /home/user/whonix_dot/Whonix/help-steps/unmount-img'

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]

OPTIONAL!

Remove temporary files.

Warning, this will run git clean -d --force --force in Whonix's main source code folder (~/Whonix) as well as in all sub folders of the Whonix packages folder ~/Whonix/packages. This means, if you knowingly added any files to any of these folders that have not been committed to git, these will be deleted.

[13]

./help-steps/cleanup-files


See Also[edit]

Footnotes[edit]

  1. Whonix-APT-Repository#Disable_Whonix_APT_Repository
  2. Get source code. Get into the source folder. Speedy parallel fetching of git submodules.
    (Credits: Thanks to Karmazzin for his answer on sourceforge.)
    git clone https://github.com/Whonix/Whonix && cd Whonix && cat .gitmodules | grep -Po '".*"' | sed 's/.\(.\+\).$/\1/' | while sleep 0.1 && read line; do git submodule update --init "$line" & done
    
  3. See Trust.
  4. Defined as per TUF: Attacks and Weaknesses:
  5. Beginning from git tag 9.6 and above.
  6. There currently is a small issue. (A limitation of git.)
  7. Setting the BARE_METAL variable to 1 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 --bare-metal, because the user is free to remove any build dependencies later.
  8. Why use "--bare-metal"? Technical explanation: "--bare-metal" in context of Whonix's 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/[...]".
  9. Unless you log in as root and run "export WHONIX_DEB_DEBUG=0".
  10. Or saying Whonix-Gateway respectively
  11. It won't, if you have "export WHONIX_DEB_DEBUG=0" set.
  12. "probably" means, if we don't change some messages in meanwhile and forget to update this page.
  13. https://github.com/Whonix/Whonix/blob/master/help-steps/cleanup-files

Random News:

Did you know that anyone can edit Whonix's wiki?


Impressum | Datenschutz | Haftungsausschluss

https | (forcing) onion
Share: Twitter | Facebook | Google+
This is a wiki. Want to improve this page? Help welcome, volunteer contributions are happily considered! See Conditions for Contributions to Whonix, then Edit! IP addresses are scrubbed, but editing over Tor is recommended. Edits are held for moderation. Whonix (g+) is a licensee of the Open Invention Network. Unless otherwise noted above, content of this page is copyrighted and licensed under the same Free (as in speech) license as Whonix itself.