GeezerVison is showing github.com — Fix apt cleanup trap replacement · setup-php/setup-php@25b6ac8
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/scripts/linux.sh +2-6Lines changed: 2 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,16 +30,12 @@ self_hosted_helper() { |
30 | 30 |
|
31 | 31 | # Function to fix broken packages. |
32 | 32 | fix_broken_packages() { |
33 | | - sudo apt --fix-broken install >/dev/null 2>&1 |
| 33 | + sudo apt --fix-broken install -o Dpkg::Options::=--force-confnew >/dev/null 2>&1 |
34 | 34 | } |
35 | 35 |
|
36 | 36 | # Function to install a package |
37 | 37 | install_packages() { |
38 | 38 | packages=("$@") |
39 | | - if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then |
40 | | - echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1 |
41 | | - trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit |
42 | | - fi |
43 | 39 | $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) |
44 | 40 | } |
45 | 41 |
|
@@ -357,7 +353,7 @@ version=${1:-'8.5'} |
357 | 353 | ini=${2:-'production'} |
358 | 354 | src=${0%/*}/.. |
359 | 355 | debconf_fix="DEBIAN_FRONTEND=noninteractive" |
360 | | -apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends" |
| 356 | +apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends -o Dpkg::Options::=--force-confnew" |
361 | 357 | scripts="$src"/scripts |
362 | 358 |
|
363 | 359 | add_sudo >/dev/null 2>&1 |
|