PostgreSQL update fails from China

I got the upgrade PostgreSQL15

Templates need to be used in sequence

postgres.13.template.yml
postgres.15.template.yml
postgres.template.yml

postgres.13.template.yml、postgres.15.template.yml file China network acceleration configuration

run:
  - exec: cat /etc/os-release && psql --version
  - exec: |
      if [ -f /etc/apt/sources.list ]; then
        sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
      else
        echo "deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware" | sudo tee /etc/apt/sources.list
        echo "deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware" | sudo tee -a /etc/apt/sources.list
      fi
  - exec: |
      if [ -f /etc/apt/sources.list.d/debian.sources ]; then
        sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
      else
        sudo bash -c 'cat > /etc/apt/sources.list.d/debian.sources <<EOF
        URIs: http://mirrors.ustc.edu.cn/debian
        Suites: bookworm bookworm-updates
        Components: main contrib non-free non-free-firmware
        Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

        Types: deb
        URIs: http://mirrors.ustc.edu.cn/debian-security
        Suites: bookworm-security
        Components: main contrib non-free non-free-firmware
        Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
        EOF'
      fi
  - exec: cat /etc/apt/sources.list && cat /etc/apt/sources.list.d/debian.sources
2 Likes