Skip to content

Commit 61a5ac3

Browse files
author
Andreas Poulsen
committed
Script to add/remove fix-broken true from apt config
1 parent 27e997c commit 61a5ac3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#! /usr/bin/env bash
2+
3+
# This script is used to add or remove the setting fix-broken "true" from the apt-get configuration
4+
# It takes a single boolean parameter: whether to add the setting or remove it
5+
6+
ACTIVATE=$1
7+
8+
APT_CONFIG_FILE=/etc/apt/apt.conf.d/local
9+
10+
# Always start by trying to remove the line to prevent duplicate entries
11+
sed --in-place '/Fix-Broken/d' $APT_CONFIG_FILE
12+
13+
if [ "$ACTIVATE" = "True" ]; then
14+
cat << EOF >> $APT_CONFIG_FILE
15+
Apt:Get {Fix-Broken "true";};
16+
EOF
17+
fi

0 commit comments

Comments
 (0)