<commit_before># Building Certbot Snaps

## Local Testing and Development

These instructions are recommended when testing anything about the snap setup for ease of debugging.
The architecture of the built snap is limited to the architecture of the system it is built on.

### Initial VM Set Up

These steps need to be done once to set up your VM and do not need to be run again to rebuild the snap.

 1. Start with a Focal VM. You need a full virtual machine using something like DigitalOcean, EC2, or VirtualBox. Docker won't work. Another version of Ubuntu can probably be used, but Focal was used when writing these instructions.
 2. Set up a user other than root with sudo privileges for use with snapcraft and run all of the following commands with it. A command to do this for a user named certbot looks like `adduser certbot && usermod -aG sudo certbot && su - certbot`.
 3. Install git and python with `sudo apt update && sudo apt install -y git python`.
 4. Set up lxd for use with snapcraft by running `sudo snap install lxd && sudo /snap/bin/lxd.migrate -yes && sudo /snap/bin/lxd waitready && sudo /snap/bin/lxd init --auto` (errors here are ok; it may already
 have been installed on your system).
 5. Add your current user to the lxd group and update your shell to have the new assignment by running `sudo usermod -a -G lxd ${USER} && newgrp lxd`.
 6. Install snapcraft with `sudo snap install --classic snapcraft`.
 7. `cd ~` (or any other directory where you want our source files to be)
 8. Run `git clone git://github.com/certbot/certbot`
 9. `cd certbot` (All further instructions are relative to this directory.)

### Certbot Snap

#### Reset the Environment

If the snap has been built before, the instructions below clean up the build environment so it can reliably be used again.
<commit_msg>Fix LXD setup in snap README (#8416)<commit_after># Building Certbot Snaps

## Local Testing and Development

These instructions are recommended when testing anything about the snap setup for ease of debugging.
The architecture of the built snap is limited to the architecture of the system it is built on.

### Initial VM Set Up

These steps need to be done once to set up your VM and do not need to be run again to rebuild the snap.

 1. Start with a Focal VM. You need a full virtual machine using something like DigitalOcean, EC2, or VirtualBox. Docker won't work. Another version of Ubuntu can probably be used, but Focal was used when writing these instructions.
 2. Set up a user other than root with sudo privileges for use with snapcraft and run all of the following commands with it. A command to do this for a user named certbot looks like `adduser certbot && usermod -aG sudo certbot && su - certbot`.
 3. Install git and python with `sudo apt update && sudo apt install -y git python`.
 4. Set up lxd for use with snapcraft by running `sudo snap install lxd && sudo /snap/bin/lxd.migrate -yes; sudo /snap/bin/lxd waitready && sudo /snap/bin/lxd init --auto` (errors here are ok; it may already
 have been installed on your system).
 5. Add your current user to the lxd group and update your shell to have the new assignment by running `sudo usermod -a -G lxd ${USER} && newgrp lxd`.
 6. Install snapcraft with `sudo snap install --classic snapcraft`.
 7. `cd ~` (or any other directory where you want our source files to be)
 8. Run `git clone git://github.com/certbot/certbot`
 9. `cd certbot` (All further instructions are relative to this directory.)

### Certbot Snap

#### Reset the Environment

If the snap has been built before, the instructions below clean up the build environment so it can reliably be used again.

{'fraction_non_alphanumeric': 0.06186695866411169, 'fraction_numerical': 0.006569942513003011, 'mean_word_length': 3.807894736842105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5246806', 'n_tokens_mistral': 998, 'n_tokens_neox': 939, 'n_words': 600}