From 38a96ca43c1eba529a74faa33a76329f2618402e Mon Sep 17 00:00:00 2001 From: opi Date: Fri, 13 May 2016 20:29:05 +0200 Subject: [PATCH] [enh] Cleanup sources.list as YunoHost use a dedicated sources file. --- lib/yunohost/tools.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/yunohost/tools.py b/lib/yunohost/tools.py index 21c71133d..59db44406 100644 --- a/lib/yunohost/tools.py +++ b/lib/yunohost/tools.py @@ -495,6 +495,14 @@ def tools_upgrade_v24(auth): os.system('apt-get update') os.system('yes "q" | DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get -y --force-yes -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade') + # Remove old repo in sources.list file + with open('/etc/apt/sources.list', "r") as sources: + lines = sources.readlines() + with open('/etc/apt/sources.list', "w") as sources: + for line in lines: + if "yunohost" not in line: + sources.write(line) + # Change sources with open('/etc/apt/sources.list.d/yunohost.list', "w") as sources: sources.write('deb http://repo.yunohost.org/debian/ jessie stable')