Skip to content

Instantly share code, notes, and snippets.

@lunitrixx
Forked from yorickdowne/friday.md
Created August 15, 2025 06:34
Show Gist options
  • Save lunitrixx/1f2ba19a23c5074137a95b1622c24e5b to your computer and use it in GitHub Desktop.
Save lunitrixx/1f2ba19a23c5074137a95b1622c24e5b to your computer and use it in GitHub Desktop.

Revisions

  1. @yorickdowne yorickdowne revised this gist Aug 10, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -34,15 +34,15 @@ sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

    - Change all 3rd-party repos

    > This assumes the repos have trixie versions. Run `sudo apt update` after the change to trixie to confirm, and deal with any repos that aren't available in trixie.
    > This assumes the repos have trixie versions. Run `sudo apt-get update` after the change to trixie to confirm, and deal with any repos that aren't available in trixie.
    ```
    sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
    ```

    - Optional: Start a screen session

    So that an SSH disconnect doesn't stop your upgrade halfway through, you can run in `screen`: `sudo apt install -y screen && screen`
    So that an SSH disconnect doesn't stop your upgrade halfway through, you can run in `screen`: `sudo apt-get install -y screen && screen`

    - Update Debian

  2. @yorickdowne yorickdowne revised this gist Aug 10, 2025. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -40,6 +40,10 @@ sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
    sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
    ```

    - Optional: Start a screen session

    So that an SSH disconnect doesn't stop your upgrade halfway through, you can run in `screen`: `sudo apt install -y screen && screen`

    - Update Debian

    For the following, say Yes to restarting services, and keep existing config files when prompted.
  3. @yorickdowne yorickdowne revised this gist Aug 10, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ Optional but recommended: Switch to `deb822` format for the `sources.list`. This

    `sudo apt modernize-sources`

    > Caveat that trixie-backports won't have a `Signed-By` until trixie has been released. You can fix this by manually setting `Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg` in `/etc/apt/sources.list.d/debian-backports.sources`
    > Caveat that trixie-backports might not have a `Signed-By` on some 3rd-party mirrors. You can fix this by manually setting `Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg` in `/etc/apt/sources.list.d/debian-backports.sources`
    ## Automated by Ansible
    Config `ansible.cfg`:
  4. @yorickdowne yorickdowne revised this gist Aug 9, 2025. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    # Debian 13

    **This is a placeholder for instructions when Debian 13 is released on the 9th of August 2025**

    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

    If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 13 "trixie" from Debian 12 "bookworm" can be helpful. 3rd-party repos are handled with a find command.
    @@ -36,7 +34,7 @@ sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

    - Change all 3rd-party repos

    > This assumes the repos have trixie versions, which should be the case after trixie release. If you're updating to trixie before release, run `sudo apt-get update` after changing everything to trixie with the below, then manually revert repos to `bookworm` that do not have a `trixie` release yet
    > This assumes the repos have trixie versions. Run `sudo apt update` after the change to trixie to confirm, and deal with any repos that aren't available in trixie.
    ```
    sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
  5. @yorickdowne yorickdowne revised this gist Jul 30, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Debian 13

    **This is a placeholder for instructions when Debian 13 is released in August 2025. Tentative full freeze date August 9th, release sometime after**
    **This is a placeholder for instructions when Debian 13 is released on the 9th of August 2025**

    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

  6. @yorickdowne yorickdowne revised this gist Jul 24, 2025. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repo

    Note upgrade is only supported from Debian 12 to Debian 13. If you are on Debian 11, [upgrade to Debian 12](https://gist.github.com/yorickdowne/ec9e2c6f4f8a2ee93193469d285cd54c) first. Then once on Debian 12, you can upgrade to Debian 13.

    > This guide is only for the OS itself. Applications are as plentiful as sand on the beach, and they may all require additional steps. Plan for that.
    - Check free disk space

    `df -h`
  7. @yorickdowne yorickdowne revised this gist Jul 20, 2025. No changes.
  8. @yorickdowne yorickdowne revised this gist Jul 20, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Debian 13

    **This is a placeholder for instructions when Debian 13 is released in August 2025**
    **This is a placeholder for instructions when Debian 13 is released in August 2025. Tentative full freeze date August 9th, release sometime after**

    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

  9. @yorickdowne yorickdowne revised this gist Feb 20, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Debian 13

    **This is a placeholder for instructions when Debian 13 is released in 2025**
    **This is a placeholder for instructions when Debian 13 is released in August 2025**

    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

  10. @yorickdowne yorickdowne revised this gist Feb 20, 2025. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -180,6 +180,10 @@ Role `base/upgrade_trixie/tasks/main.yml`:
    post_reboot_delay: 60
    test_command: whoami
    become: yes
    - name: Modernize apt sources
    ansible.builtin.command:
    cmd: apt -y modernize-sources
    become: yes
    - name: Pause for 5 minutes for staggered upgrades
    pause:
    minutes: 5
  11. @yorickdowne yorickdowne revised this gist Feb 20, 2025. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,14 @@ And finally, reboot

    `sudo reboot`

    - Modernize Debian sources

    Optional but recommended: Switch to `deb822` format for the `sources.list`. This will write `/etc/apt/sources.list.d/debian.sources` and `/etc/apt/sources.list.d/debian-backports.sources`

    `sudo apt modernize-sources`

    > Caveat that trixie-backports won't have a `Signed-By` until trixie has been released. You can fix this by manually setting `Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg` in `/etc/apt/sources.list.d/debian-backports.sources`
    ## Automated by Ansible
    Config `ansible.cfg`:
    ```
  12. @yorickdowne yorickdowne revised this gist Jan 30, 2025. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -51,6 +51,11 @@ And finally, reboot
    `sudo reboot`

    ## Automated by Ansible
    Config `ansible.cfg`:
    ```
    [defaults]
    interpreter_python = /usr/bin/python3
    ```

    Playbook `trixie.yml`:

  13. @yorickdowne yorickdowne revised this gist Jan 5, 2025. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,8 @@ sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

    - Change all 3rd-party repos

    > This assumes the repos have trixie versions, which should be the case after trixie release. If you're updating to trixie before release, run `sudo apt-get update` after changing everything to trixie with the below, then manually revert repos to `bookworm` that do not have a `trixie` release yet
    ```
    sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
    ```
  14. @yorickdowne yorickdowne revised this gist Nov 23, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -102,7 +102,7 @@ Role `base/upgrade_trixie/tasks/main.yml`:
    - name: Check if reboot required
    ansible.builtin.stat:
    path: /run/reboot-required
    get_md5: no
    get_checksum: no
    register: reboot_required_file
    - name: Reboot if required
    ansible.builtin.reboot:
  15. @yorickdowne yorickdowne revised this gist Oct 10, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Debian 13

    **This has not been tested, and is a placeholder for instructions when Debian 13 is released in 2025**
    **This is a placeholder for instructions when Debian 13 is released in 2025**

    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

  16. @yorickdowne yorickdowne revised this gist Oct 10, 2024. 1 changed file with 0 additions and 10 deletions.
    10 changes: 0 additions & 10 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -156,16 +156,6 @@ Role `base/upgrade_trixie/tasks/main.yml`:
    apt:
    clean: yes
    become: yes
    - name: Re-enable msmtp apparmor profile
    ansible.builtin.file:
    path: /etc/apparmor.d/disable/usr.bin.msmtp
    state: absent
    become: yes
    - name: Restart apparmor service
    ansible.builtin.systemd:
    name: apparmor
    state: restarted
    become: yes
    - name: Reboot on trixie
    ansible.builtin.reboot:
    msg: "Reboot initiated by Ansible"
  17. @yorickdowne yorickdowne revised this gist Oct 10, 2024. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,6 @@ sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {}
    - Update Debian

    For the following, say Yes to restarting services, and keep existing config files when prompted.
    If using msmtp, acknowledge warnings. AppArmor for msmtp worked for me.

    `sudo apt-get update && sudo apt-get dist-upgrade --autoremove -y`

  18. @yorickdowne yorickdowne revised this gist Apr 8, 2024. No changes.
  19. @yorickdowne yorickdowne revised this gist Apr 8, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion friday.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    **This has not been tested, and is a placeholder for instructions when Debian 13 is released in 2025**

    To start, read the [official release notes]([https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.html](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html)).
    To start, read the [official release notes](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html).

    If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 13 "trixie" from Debian 12 "bookworm" can be helpful. 3rd-party repos are handled with a find command.

  20. @yorickdowne yorickdowne created this gist Apr 8, 2024.
    182 changes: 182 additions & 0 deletions friday.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,182 @@
    # Debian 13

    **This has not been tested, and is a placeholder for instructions when Debian 13 is released in 2025**

    To start, read the [official release notes]([https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.html](https://www.debian.org/releases/trixie/release-notes/upgrading.en.html)).

    If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 13 "trixie" from Debian 12 "bookworm" can be helpful. 3rd-party repos are handled with a find command.

    Note upgrade is only supported from Debian 12 to Debian 13. If you are on Debian 11, [upgrade to Debian 12](https://gist.github.com/yorickdowne/ec9e2c6f4f8a2ee93193469d285cd54c) first. Then once on Debian 12, you can upgrade to Debian 13.

    - Check free disk space

    `df -h`

    5 GiB free is a conservative amount. `sudo apt clean` and `sudo apt autoremove` can be used to free some disk space.

    On a server with only docker installed, even 1 GiB free was sufficient. Do err on the side of caution here, however.

    - Identify any 3rd-party repos that may need to be updated. They'll be changed with a `find` command, below.

    `ls /etc/apt/sources.list.d`

    - Update current distribution

    `sudo apt-get update && sudo apt-get dist-upgrade --autoremove -y`

    If this brought in a new kernel, `sudo reboot` - otherwise continue

    - Change repo to trixie, from bookworm.

    ```
    sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
    ```

    - Change all 3rd-party repos

    ```
    sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
    ```

    - Update Debian

    For the following, say Yes to restarting services, and keep existing config files when prompted.
    If using msmtp, acknowledge warnings. AppArmor for msmtp worked for me.

    `sudo apt-get update && sudo apt-get dist-upgrade --autoremove -y`

    And finally, reboot

    `sudo reboot`

    ## Automated by Ansible

    Playbook `trixie.yml`:

    ```
    ---
    - name: Upgrade to Debian trixie
    hosts: all
    serial: 1
    gather_facts: false
    roles:
    - base/upgrade_trixie
    ```

    Role `base/upgrade_trixie/tasks/main.yml`:

    ```
    ---
    - name: Get distribution version
    setup:
    filter: ansible_distribution*
    - name: Skip if not Debian 12
    meta: end_host
    when: ansible_distribution != 'Debian' or ansible_distribution_major_version != '12'
    - name: apt clean
    apt:
    clean: yes
    become: yes
    - name: Get filesystem facts
    setup:
    filter: ansible_mounts
    - name: Fail if free space on / is below 5 GiB
    ansible.builtin.assert:
    that:
    - item.size_available > (5 * 1024 * 1024 * 1024)
    fail_msg: "Free disk space on {{ item.mount }} is below 5 GiB"
    loop: "{{ ansible_mounts }}"
    when: item.mount == "/"
    - name: All apt packages up to date
    apt:
    upgrade: dist
    update_cache: yes
    become: yes
    - name: apt autoremove
    apt:
    autoremove: yes
    become: yes
    - name: apt clean
    apt:
    clean: yes
    become: yes
    - name: Check if reboot required
    ansible.builtin.stat:
    path: /run/reboot-required
    get_md5: no
    register: reboot_required_file
    - name: Reboot if required
    ansible.builtin.reboot:
    msg: "Reboot initiated by Ansible"
    connect_timeout: 5
    reboot_timeout: 600
    pre_reboot_delay: 0
    post_reboot_delay: 60
    test_command: whoami
    when: reboot_required_file.stat.exists
    become: true
    - name: Switch OS from bookworm to trixie
    ansible.builtin.replace:
    path: /etc/apt/sources.list
    regexp: 'bookworm'
    replace: 'trixie'
    become: yes
    - name: Find all 3rd-party repos
    ansible.builtin.find:
    paths: /etc/apt/sources.list.d
    patterns: '*'
    recurse: no
    register: third_party_repos
    - name: Switch 3rd-party repos from bookworm to trixie
    ansible.builtin.replace:
    path: "{{ item.path }}"
    regexp: 'bookworm'
    replace: 'trixie'
    loop: "{{ third_party_repos.files }}"
    loop_control:
    label: "{{ item.path }}"
    become: yes
    - name: Use apt to move to trixie
    apt:
    upgrade: dist
    update_cache: yes
    become: yes
    - name: Get distribution version
    setup:
    filter: ansible_distribution*
    - name: Fail if not Debian 13
    assert:
    that:
    - ansible_distribution_major_version == '13'
    fail_msg: "Upgrade to Debian 13 failed"
    - name: apt autoremove
    apt:
    autoremove: yes
    become: yes
    - name: apt clean
    apt:
    clean: yes
    become: yes
    - name: Re-enable msmtp apparmor profile
    ansible.builtin.file:
    path: /etc/apparmor.d/disable/usr.bin.msmtp
    state: absent
    become: yes
    - name: Restart apparmor service
    ansible.builtin.systemd:
    name: apparmor
    state: restarted
    become: yes
    - name: Reboot on trixie
    ansible.builtin.reboot:
    msg: "Reboot initiated by Ansible"
    connect_timeout: 5
    reboot_timeout: 600
    pre_reboot_delay: 0
    post_reboot_delay: 60
    test_command: whoami
    become: yes
    - name: Pause for 5 minutes for staggered upgrades
    pause:
    minutes: 5
    ```