2018/11/07

Raspbian - How to solve the problem of "xxx is is configured multiple times in /etc/apt/sources.list:xx and /etc/apt/sources.list.d/raspi.list:xx"

I ran into problem highlighted in yellow below when running "sudo apt-get update" on my RPI after upgrading from Raspbian Jessie to Raspbian Stretch.

pi@raspberrypi:~ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Fetched 11.0 kB in 5s (2,032 B/s)
Reading package lists... Done
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (ui/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (ui/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (ui/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (ui/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (ui/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (ui/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (ui/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (ui/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:9 and /etc/apt/sources.list.d/raspi.list:1
pi@raspberrypi:~ $ 

Below is the content of /etc/apt/sources.list.

pi@raspberrypi:~ $ cat /etc/apt/sources.list
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# deb http://raspbian.raspberrypi.org/raspbian stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
#deb http://ftp.debian.org/debian stretch-backports main
#deb http://raspbian.raspberrypi.org/raspbian/ testing main contrib non-free rpi

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi firmware
deb http://archive.raspberrypi.org/debian/ stretch main ui
pi@raspberrypi:~ $

Below is the content of /etc/apt/sources.list.d/raspi.list.

pi@raspberrypi:~ $ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
pi@raspberrypi:~ $

It turns out "deb http://archive.raspberrypi.org/debian/ stretch main ui" appears in both files.

The Solution

Step-1, Comment out "deb http://archive.raspberrypi.org/debian/ stretch main ui" by adding a # sign in front of it in /etc/apt/sources.list.d/raspi.list.

pi@raspberrypi:~ $ cat /etc/apt/sources.list.d/raspi.list
# deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
pi@raspberrypi:~ $


Save the file when done.

Step-2, Do "sudo apt-get update" again.

pi@raspberrypi:~ $ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Get:2 http://repo.mosquitto.org/debian stretch InRelease [11.0 kB]
Hit:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Ign:2 http://repo.mosquitto.org/debian stretch InRelease
Fetched 11.0 kB in 5s (1,965 B/s)
Reading package lists... Done
W: GPG error: http://repo.mosquitto.org/debian stretch InRelease: The following signatures were invalid: EXPKEYSIG 61611AE430993623 Mosquitto Apt Repository <repo@mosquitto.org>
W: The repository 'http://repo.mosquitto.org/debian stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
pi@raspberrypi:~ $

The problem of "xxx is is configured multiple times in /etc/apt/sources.list:xx and /etc/apt/sources.list.d/raspi.list:xx" is solved.

As for the issue with MQTT, it will be addressed in my next post at https://wei48221.blogspot.com/2018/11/raspberry-pi-upgrading-mqtt-from.html.

No comments:

Post a Comment