Can't update to January release

Hello everyone.
After reading on Facebook that there is a January update I’ve decided to update my RPi3 (like always). I have automatic updates set to never so I always go to MyOSMC and check manually for them. Unfortunately I can’t update. After checking there’s a window that there was an error and to report it. So that’s what I do. Can you help me please?

OSMC installed on RPi3 with NFS install on Synology. Database saved onto MySQL on Synology. Logs are here: https://pastebin.com/KDvUjgX8

I have also backed up logs from MyOSMC but I don’t know where to find them… If they will be needed, please let me know.

Please provide full logs vial grab-logs -A

Done!
https://paste.osmc.tv/behucizoho

You can normally either update from the command line or through the My OSMC interface. In this case, it looks like the My OSMC update has failed but the underlying cause isn’t clear.

Please run the following commands from the command line to see if this fixes the problem:

sudo apt-get update
sudo apt-get install --reinstall python-apt python-apt-common
reboot

When the system returns, once again try to update through My OSMC.

If that fails, please try this from the command line:

sudo apt-get dist-upgrade

and show us the output.

After first command:

osmc@salon:~$ sudo apt-get update
Ign:2 Index of /debian stretch InRelease
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Hit:5 Index of /debian stretch Release
Get:3 Index of /debian stretch-updates InRelease [91.0 kB]
Get:4 Index of /osmc/osmc/apt stretch InRelease [4667 B]
Err:6 Index of /debian stretch Release.gpg
At least one invalid signature was encountered.
Err:1 http://security.debian.org stretch/updates InRelease
At least one invalid signature was encountered.
Err:4 Index of /osmc/osmc/apt stretch InRelease
At least one invalid signature was encountered.
Err:3 Index of /debian stretch-updates InRelease
At least one invalid signature was encountered.
Fetched 159 kB in 3s (44.6 kB/s)
Reading package lists… Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: Index of /debian stretch Release: At least one invalid signature was encountered.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org stretch/updates InRelease: At least one invalid signature was encountered.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: Index of /osmc/osmc/apt stretch InRelease: At least one invalid signature was encountered.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: Index of /debian stretch-updates InRelease: At least one invalid signature was encountered.
W: Failed to fetch http://ftp.debian.org/debian/dists/stretch-updates/InRelease At least one invalid signature was encountered.
W: Failed to fetch http://security.debian.org/dists/stretch/updates/InRelease At least one invalid signature was encountered.
W: Failed to fetch http://apt.osmc.tv/dists/stretch/InRelease At least one invalid signature was encountered.
W: Failed to fetch http://ftp.debian.org/debian/dists/stretch/Release.gpg At least one invalid signature was encountered.
W: Some index files failed to download. They have been ignored, or old ones used instead.

Next

osmc@salon:~$ sudo apt-get install --reinstall python-apt python-apt-common
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
armv7-libcrossguid-osmc bluez libapt-inst1.5 libbind9-90 libdbus-1-dev libdns100 libdpkg-perl libgif4 libgnutls-deb0-28 libhogweed2 libicu52 libisc95 libisccc90
libisccfg90 libjasper1 liblwres90 libmicrohttpd10 libmysqlclient18 libnettle4 libntdb1 libplist2 libpng12-0 libpsl0 libssl1.0.0 libwebp5 libwebpdemux1 libwebpmux1
libxtables10 pkg-config python-dbus-dev
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/252 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database … 28101 files and directories currently installed.)
Preparing to unpack …/python-apt-common_1.4.0~beta3_all.deb …
Unpacking python-apt-common (1.4.0~beta3) over (1.4.0~beta3) …
Preparing to unpack …/python-apt_1.4.0~beta3_armhf.deb …
Unpacking python-apt (1.4.0~beta3) over (1.4.0~beta3) …
Setting up python-apt-common (1.4.0~beta3) …
Setting up python-apt (1.4.0~beta3) …

Updating from MyOSMC gave the same error.

The last command I will try in an hour after my wife finish the movie she’s watching.

And the last command did

osmc@salon:~$ sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages were automatically installed and are no longer required:
armv7-libcrossguid-osmc bluez libapt-inst1.5 libbind9-90 libdbus-1-dev libdns100 libdpkg-perl libgif4 libgnutls-deb0-28 libhogweed2 libicu52 libisc95 libisccc90
libisccfg90 libjasper1 liblwres90 libmicrohttpd10 libmysqlclient18 libnettle4 libntdb1 libplist2 libpng12-0 libpsl0 libssl1.0.0 libwebp5 libwebpdemux1 libwebpmux1
libxtables10 pkg-config python-dbus-dev
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Please post the URL from running apt-key list | paste-log

There you go!
https://paste.osmc.tv/tatedoyuhi

That looks fine.

Please run:

sudo find /var/lib/apt/lists -type f -delete
sudo apt-get update

Done, but nothing has changed.

osmc@salon:~$ sudo find /var/lib/apt/lists -type f -delete
osmc@salon:~$ sudo apt-get update
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 Index of /debian stretch InRelease
Get:3 Index of /debian stretch-updates InRelease [91.0 kB]
Get:5 Index of /debian stretch Release [118 kB]
Get:6 Index of /debian stretch Release.gpg [2434 B]
Get:4 Index of /osmc/osmc/apt stretch InRelease [4667 B]
Err:1 http://security.debian.org stretch/updates InRelease
At least one invalid signature was encountered.
Err:3 Index of /debian stretch-updates InRelease
At least one invalid signature was encountered.
Ign:6 Index of /debian stretch Release.gpg
Err:4 Index of /osmc/osmc/apt stretch InRelease
At least one invalid signature was encountered.
Reading package lists… Done
W: GPG error: http://security.debian.org stretch/updates InRelease: At least one invalid signature was encountered.
E: The repository ‘http://security.debian.org stretch/updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch-updates InRelease: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch-updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch Release: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /osmc/osmc/apt stretch InRelease: At least one invalid signature was encountered.
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I just noticed you have two versions of libapt-inst installed:

ii  libapt-inst1.5:armhf                 1.0.9.8.4                      armhf        deb package format runtime library
ii  libapt-inst2.0:armhf                 1.4.8                          armhf        deb package format runtime library

Only version 2.0 should be there. Perhaps removing version 1.5 will help.

sudo apt-get remove libapt-inst1.5
reboot

After it comes back:

sudo apt-get update

I have uninstalled libapt

osmc@salon:~$ sudo apt-get remove libapt-inst1.5
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
armv7-libcrossguid-osmc bluez libbind9-90 libdbus-1-dev libdns100 libdpkg-perl libgif4 libgnutls-deb0-28 libhogweed2 libicu52 libisc95 libisccc90 libisccfg90
libjasper1 liblwres90 libmicrohttpd10 libmysqlclient18 libnettle4 libntdb1 libplist2 libpng12-0 libpsl0 libssl1.0.0 libwebp5 libwebpdemux1 libwebpmux1 libxtables10
pkg-config python-dbus-dev
Use ‘sudo apt autoremove’ to remove them.
The following packages will be REMOVED:
libapt-inst1.5
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 339 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 28101 files and directories currently installed.)
Removing libapt-inst1.5:armhf (1.0.9.8.4) …

After reboot I did an update but nothing has changed :confused:

osmc@salon:~$ sudo apt-get update
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 Index of /debian stretch InRelease
Get:3 Index of /debian stretch-updates InRelease [91.0 kB]
Get:5 Index of /debian stretch Release [118 kB]
Get:4 Index of /osmc/osmc/apt stretch InRelease [4667 B]
Get:6 Index of /debian stretch Release.gpg [2434 B]
Err:1 http://security.debian.org stretch/updates InRelease
At least one invalid signature was encountered.
Err:3 Index of /debian stretch-updates InRelease
At least one invalid signature was encountered.
Err:4 Index of /osmc/osmc/apt stretch InRelease
At least one invalid signature was encountered.
Ign:6 Index of /debian stretch Release.gpg
Reading package lists… Done
W: GPG error: http://security.debian.org stretch/updates InRelease: At least one invalid signature was encountered.
E: The repository ‘http://security.debian.org stretch/updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch-updates InRelease: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch-updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /osmc/osmc/apt stretch InRelease: At least one invalid signature was encountered.
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch Release: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Dzień dobry,

This is a bit of a head scratcher. :wink:

Please run these commands:

cd /tmp
wget http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
sha256sum debian-archive-keyring_2017.5_all.deb

It should return a SHA256 value of 6a38407c47fefad2d8459dc271d109f1841ee857f993ed3ce2884e33f7f0f734

If the SHA256 value is correct, run:

sudo dpkg -i debian-archive-keyring_2017.5_all.deb

Assuming you have no errors :wink: run:

gpgv --keyring /etc/apt/trusted.gpg  /var/lib/apt/lists/apt.osmc.tv_dists_stretch_InRelease

It should return:

gpgv: Signature made Wed 07 Feb 2018 10:22:54 GMT
gpgv:                using RSA key 553B25A766C762CC
gpgv: Good signature from "Sam G Nazarko <email@samnazarko.co.uk>"

We can take it from there, depending on what you find.

Edit: Fixed typo.

Hello, nice to know that someone know foreign languages :wink:

To the point. SHA matches.

osmc@salon:~$ cd /tmp
osmc@salon:/tmp$ wget http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
–2018-02-11 12:50:14-- http://ftp.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
Resolving ftp.debian.org (ftp.debian.org)… 130.89.148.12, 2001:67c:2564:a119::148:12
Connecting to ftp.debian.org (ftp.debian.org)|130.89.148.12|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 56438 (55K) [application/x-debian-package]
Saving to: ‘debian-archive-keyring_2017.5_all.deb’

debian-archive-keyring_2017.5_all.deb 100%[=====================================================================================>] 55.12K --.-KB/s in 0.1s

2018-02-11 12:50:14 (446 KB/s) - ‘debian-archive-keyring_2017.5_all.deb’ saved [56438/56438]

osmc@salon:/tmp$ sha256sum debian-archive-keyring_2017.5_all.deb
6a38407c47fefad2d8459dc271d109f1841ee857f993ed3ce2884e33f7f0f734 debian-archive-keyring_2017.5_all.deb

I assume there were no errors…

osmc@salon:/tmp$ sudo dpkg -i debian-archive-keyring_2017.5_all.deb
(Reading database … 28052 files and directories currently installed.)
Preparing to unpack debian-archive-keyring_2017.5_all.deb …
Unpacking debian-archive-keyring (2017.5) over (2017.5) …
Setting up debian-archive-keyring (2017.5) …

And it returned that there’s no such file or directory…

osmc@salon:/tmp$ gpgv --keyring /etc/apt/trusted.gpg /var/lib/apt/lists/apt.osmc.tv_dists_stretch_InRelease
gpgv: can’t open ‘/var/lib/apt/lists/apt.osmc.tv_dists_stretch_InRelease’: No such file or directory
gpgv: verify signatures failed: No such file or directory

This is the first time I have such a problem. Last few years starting from Crystalbuntu everything worked like a charm. Pesky technology…

I hope that you will figure something :slight_smile:

PS
I took a look into /var/lib/apt/lists . This is what I found…

osmc@salon:/var/lib/apt/lists$ ls -al
total 66328
drwxr-xr-x 3 root root 4096 Feb 10 19:55 .
drwxr-xr-x 5 root root 4096 Feb 11 09:00 …
-rw-r–r-- 1 root root 1435720 Jan 8 23:32 .nfs000000000018005600000025
-rw-r–r-- 1 root root 2595 Aug 13 16:17 .nfs000000000018014300000023
-rw-r–r-- 1 root root 0 Jun 18 2017 .nfs000000000018014600000024
-rw-r–r-- 1 root root 783755 Jan 8 23:32 .nfs00000000001801480000002b
-rw-r–r-- 1 root root 3330 Dec 12 12:16 .nfs000000000018016a00000026
-rw-r–r-- 1 root root 2667 Dec 20 22:47 .nfs000000000018016b00000027
-rw-r–r-- 1 root root 0 Jun 18 2017 .nfs000000000018016d00000028
-rw-r–r-- 1 root root 0 Jun 18 2017 .nfs000000000018016e00000029
-rw-r–r-- 1 root root 25694 Oct 26 22:12 .nfs00000000001801700000002a
-rw-r–r-- 1 root root 13428 Oct 26 22:12 .nfs00000000001801710000002c
-rw-r–r-- 1 root root 0 Jun 18 2017 .nfs00000000001801720000002d
-rw-r–r-- 1 root root 942 Jun 11 2017 .nfs00000000001801730000002e
-rw-r–r-- 1 root root 140522 Jan 7 04:29 .nfs00000000001801750000002f
-rw-r–r-- 1 root root 37988857 Dec 9 09:50 .nfs000000000018017600000031
-rw-r–r-- 1 root root 187398 Jun 18 2017 .nfs00000000001802ba00000030
-rw-r–r-- 1 root root 26442901 Dec 9 09:49 .nfs00000000001802fd00000034
-rw-r–r-- 1 root root 186282 Dec 9 09:49 .nfs00000000001805e300000032
-rw-r–r-- 1 root root 280789 Dec 9 09:49 .nfs00000000001805e400000033
-rw-r–r-- 1 root root 381536 Oct 7 11:04 .nfs00000000001805ea00000035
-rw-r----- 1 root root 0 Feb 10 19:55 lock
drwx------ 2 _apt root 4096 Feb 11 09:18 partial

And partial subdirectory contains:

osmc@salon:/var/lib/apt/lists/partial$ ls -al
total 292
drwx------ 2 _apt root 4096 Feb 11 09:18 .
drwxr-xr-x 3 root root 4096 Feb 10 19:55 …
-rw-r–r-- 1 root root 4667 Feb 7 11:22 apt.osmc.tv_dists_stretch_InRelease
-rw-r–r-- 1 root root 91028 Feb 11 03:38 ftp.debian.org_debian_dists_stretch-updates_InRelease
-rw-r–r-- 1 root root 118066 Dec 9 10:17 ftp.debian.org_debian_dists_stretch_Release.FAILED
-rw-r–r-- 1 root root 2434 Dec 9 10:22 ftp.debian.org_debian_dists_stretch_Release.gpg
-rw-r–r-- 1 root root 62959 Feb 10 23:03 security.debian.org_dists_stretch_updates_InRelease

Hope this help.

Jestem międzynarodowym psem.

Good work. I would have asked you to look in /var/lib/apt/lists. Clearly, it’s not right.

Now you should have a good keyring file, I guess we need to clear out the bad release data and try an apt-get update again. This time, please check /var/lib/apt/lists immediately after the update.

sudo find /var/lib/apt/lists -type f -delete
sudo apt-get update

Sorry, still no go.

osmc@salon:~$ sudo find /var/lib/apt/lists -type f -delete
osmc@salon:~$ ls -al /var/lib//apt/lists/
total 12
drwxr-xr-x 3 root root 4096 Feb 11 13:33 .
drwxr-xr-x 5 root root 4096 Feb 11 09:00 …
drwx------ 2 _apt root 4096 Feb 11 13:33 partial
osmc@salon:~$ sudo apt-get update
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 Index of /debian stretch InRelease
Get:3 Index of /debian stretch-updates InRelease [91.0 kB]
Get:5 Index of /debian stretch Release [118 kB]
Get:4 Index of /osmc/osmc/apt stretch InRelease [4667 B]
Get:6 Index of /debian stretch Release.gpg [2434 B]
Err:1 http://security.debian.org stretch/updates InRelease
At least one invalid signature was encountered.
Err:3 Index of /debian stretch-updates InRelease
At least one invalid signature was encountered.
Err:4 Index of /osmc/osmc/apt stretch InRelease
At least one invalid signature was encountered.
Ign:6 Index of /debian stretch Release.gpg
Reading package lists… Done
W: GPG error: http://security.debian.org stretch/updates InRelease: At least one invalid signature was encountered.
E: The repository ‘http://security.debian.org stretch/updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch-updates InRelease: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch-updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /osmc/osmc/apt stretch InRelease: At least one invalid signature was encountered.
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch Release: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
osmc@salon:~$ ls -al /var/lib//apt/lists/
total 12
drwxr-xr-x 3 root root 4096 Feb 11 13:33 .
drwxr-xr-x 5 root root 4096 Feb 11 09:00 …
-rw-r----- 1 root root 0 Feb 11 13:33 lock
drwx------ 2 _apt root 4096 Feb 11 13:33 partial

Run:

cd /tmp
wget http://ftp.fau.de/osmc/osmc/apt/dists/stretch/InRelease -O InRelease-test
gpgv -vv --keyring /etc/apt/trusted.gpg  /tmp/InRelease-test

It should return:

gpgv: armor: BEGIN PGP SIGNED MESSAGE
gpgv: armor header: Hash: SHA512
# off=0 ctb=ff tag=63 hlen=2 plen=11 new-ctb
:packet 63: length 11 - gpg control packet# off=13 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
gpgv: armor: BEGIN PGP SIGNATURE
gpgv: armor header: Version: GnuPG v2
:literal data packet:
	mode t (74), created 0, name="",
	raw data: unknown length
gpgv: original file name=''
# off=4176 ctb=89 tag=2 hlen=3 plen=284
:signature packet: algo 1, keyid 553B25A766C762CC
	version 4, created 1517998974, md5len 0, sigclass 0x01
	digest algo 10, begin of digest 77 60
	hashed subpkt 2 len 4 (sig created 2018-02-07)
	subpkt 16 len 8 (issuer key ID 553B25A766C762CC)
	data: [2047 bits]
gpgv: Signature made Wed 07 Feb 2018 10:22:54 GMT
gpgv:                using RSA key 553B25A766C762CC
gpgv: Good signature from "Sam G Nazarko <email@samnazarko.co.uk>"
gpgv: textmode signature, digest algorithm SHA512, key algorithm rsa2048

Sorry for the delay. I did that.

osmc@salon:~$ cd /tmp
osmc@salon:/tmp$ wget http://ftp.fau.de/osmc/osmc/apt/dists/stretch/InRelease -O InRelease-test
–2018-02-11 15:58:29-- http://ftp.fau.de/osmc/osmc/apt/dists/stretch/InRelease
Resolving ftp.fau.de (ftp.fau.de)… 131.188.12.211, 2001:638:a000:1021:21::1
Connecting to ftp.fau.de (ftp.fau.de)|131.188.12.211|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 4667 (4.6K)
Saving to: ‘InRelease-test’

InRelease-test 100%[=====================================================================================>] 4.56K --.-KB/s in 0s

2018-02-11 15:58:29 (50.4 MB/s) - ‘InRelease-test’ saved [4667/4667]

osmc@salon:/tmp$ gpgv -vv --keyring /etc/apt/trusted.gpg /tmp/InRelease-test
gpgv: armor: BEGIN PGP SIGNED MESSAGE
gpgv: armor header: Hash: SHA512

off=0 ctb=ff tag=63 hlen=2 plen=11 new-ctb

:packet 63: length 11 - gpg control packet# off=13 ctb=cb tag=11 hlen=2 plen=0 partial new-ctb
gpgv: armor: BEGIN PGP SIGNATURE
gpgv: armor header: Version: GnuPG v2
:literal data packet:
mode t (74), created 0, name=“”,
raw data: unknown length
gpgv: original file name=‘’

off=4176 ctb=89 tag=2 hlen=3 plen=284

:signature packet: algo 1, keyid 553B25A766C762CC
version 4, created 1517998974, md5len 0, sigclass 0x01
digest algo 10, begin of digest 77 60
hashed subpkt 2 len 4 (sig created 2018-02-07)
subpkt 16 len 8 (issuer key ID 553B25A766C762CC)
data: [2047 bits]
gpgv: Signature made Wed Feb 7 11:22:54 2018 CET
gpgv: using RSA key 553B25A766C762CC
gpgv: Good signature from “Sam G Nazarko email@samnazarko.co.uk
gpgv: textmode signature, digest algorithm SHA512, key algorithm rsa2048

Next I run sudo apt-get update and ther’s still the same message about invalid signature.

osmc@salon:/tmp$ sudo apt-get update
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 Index of /debian stretch InRelease
Get:4 Index of /debian stretch Release [118 kB]
Get:3 Index of /debian stretch-updates InRelease [91.0 kB]
Get:5 Index of /osmc/osmc/apt stretch InRelease [4667 B]
Get:6 Index of /debian stretch Release.gpg [2434 B]
Err:1 http://security.debian.org stretch/updates InRelease
At least one invalid signature was encountered.
Err:3 Index of /debian stretch-updates InRelease
At least one invalid signature was encountered.
Err:5 Index of /osmc/osmc/apt stretch InRelease
At least one invalid signature was encountered.
Ign:6 Index of /debian stretch Release.gpg
Reading package lists… Done
W: GPG error: http://security.debian.org stretch/updates InRelease: At least one invalid signature was encountered.
E: The repository ‘http://security.debian.org stretch/updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch-updates InRelease: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch-updates InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /osmc/osmc/apt stretch InRelease: At least one invalid signature was encountered.
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: Index of /debian stretch Release: At least one invalid signature was encountered.
E: The repository ‘Index of /debian stretch Release’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Please run the following:

find /etc/apt -name \*.gpg -exec md5sum {} \;

Here…

osmc@salon:~$ find /etc/apt -name *.gpg -exec md5sum {} ;
28ffc0824518a9d42fb40e5caad7c5ef /etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg
722258fff5af68c002429c4433bd228b /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg
3cf5c69a2532cc3a3cba6c5bcf02cb7b /etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg
e5d3c1f7461bc12685f9b331c60beadd /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg
548a861c55fdf06fb9b0419c30cd33ec /etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg
c82e16869fb2d6234aff8b63fa00fb65 /etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg
829333ce438185f23bd9c122a19ef25d /etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg
9fcd290147d1ed6b6768c1d1163f1383 /etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg
ddc8933624933852bca575837826cf05 /etc/apt/trusted.gpg

Edit:
I’ve just tried to update my second RPi1. The same error occurred. Might not be single case scenario. Both Pi’s are NFS install on my Synology. Maybe this is a problem? In the past those kind of install gave few errors during different updates. Just a thought.

I think this might be the cause of your problem, though if you didn’t have an issue with Debian jessie, then this is probably something new with stretch.

There is a similar problem here:

Perhaps @sam_nazarko can look at this.