From a96c47837a34b53439a85b12b488e847bf4668ca Mon Sep 17 00:00:00 2001 From: Ryan Fortner Date: Wed, 8 Jun 2022 16:07:26 -0400 Subject: [PATCH] remove conflicting list file first if there is one --- api | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api b/api index 5a43a39af92..222723d0b1a 100755 --- a/api +++ b/api @@ -393,7 +393,9 @@ add_external_repo() { # add an external apt repo and its gpg key fi # check if .list file already exists - [ -f /etc/apt/sources.list.d/${reponame}.list ] && error "add_external_repo: /etc/apt/sources.list.d/${reponame}.list already exists." + if [ -f /etc/apt/sources.list.d/${reponame}.list ]; then + sudo rm -f /etc/apt/sources.list.d/${reponame}.list || error "add_external_repo: failed to remove conflicting .list file." + fi # download gpg key from specified url if [ -f /usr/share/keyrings/${reponame-keyring.gpg} ]; then