# Tweed.MAINTAIN Copyright © 2016 Paul Garlick <[pgarlick@tourbillion-technology.com](mailto:pgarlick@tourbillion-technology.com)> Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. *TWEED* applications are upgraded by updating the respective package manager. The update procedure installs new versions of the applications and any new versions of dependencies. The update frequency can be determined by keeping an eye out for new application versions. If there are of the order of ten version upgrades per year, for example, then a monthly upgrade cycle would be a good way to keep up-to-date. All three package managers use a hash value as part of the pathname for an application. Since all versions of an application have a different hash value there is no conflict between older and newer versions. Older versions are retained in the store by default. It is possible to immediately switch to any version that has previously been installed. Each of the three package managers has its own update procedure. To upgrade any given application it is only necessary to update one package manager. Sometimes an application has not been upgraded but some of its dependencies have been. It is up to the user to decide whether or not to update the package manager in this case. It is often acceptable to skip the dependency updates and wait for an upgrade to the application itself. The update procedures are outlined below. Each package manager also offers a way to delete unused files. This is termed *garbage collection*. Part 1: GNU Guix update procedure --------------------------------- The command to update the GNU Guix installation is: $ guix package --upgrade The command to delete unused files is: $ guix gc --collect-garbage The command to delete previous application versions is: $ guix package --delete-generations The command to download the latest version of GNU Guix, with its list of the new package versions, is: $ guix pull More information on these commands is avaialable in the [GNU Guix manual](https://www.gnu.org/software/guix/manual/html_node/index.html). Part 2: Nix update procedure ---------------------------- The command to update the Nix installation is: $ nix-env --upgrade The command to delete unused files is: $ nix-store --gc The command to delete previous application versions is: $ nix-env --delete-generations old The command to download the latest list of the packages is: $ nix-channel --update More information on these commands is avaialable in the [Nix manual](http://nixos.org/nix/manual/). Part 3: HashDist update procedure --------------------------------- There are two stages to an update of the HashDist store; first updating the HashStack with the latest build instructions, then re-running the build process. To update the HashStack use git: $ git pull origin master The HashDist update procedure is a repeat of the latter part of the original installation process. First, move to the HashStack directory and delete the ``default`` link: $ rm default Then, for a system with M cores available for the build process, run the command: $ hit build -jM followed by: $ sh tweed.hashdist.post-install HashDist deletes previous application versions and removes unused files in one command: $ hit gc More information on HashDist is avaialable in the [HashDist manual](http://hashdist.readthedocs.io/en/latest/index.html).