I am using a Raspberry Pi A+ with Raspbian Jessie. I am encountering very strange errors where modifications I have performed seem to be reverted a while after.
Example 1: I removed in /etc/apt/sources.list.d file collabora.list and raspi.list. It works ok (no error on rm, and the directory is then empty). But after a while, this is what I see:
$ ls -al
ls: cannot access collabora.list: No such file or directory
ls: cannot access raspi.list: No such file or directory
total 8
drwxr-xr-x 2 root root 4096 Apr 4 09:57 .
drwxr-xr-x 6 root root 4096 Dec 21 2016 ..
-????????? ? ? ? ? ? collabora.list
-????????? ? ? ? ? ? raspi.list
Example 2: I had added these 2 lines in /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Again, it worked for a while. And then suddenly, I see have IPv6 again and that the file no longer has my lines!!
$ grep ipv6 /etc/sysctl.conf
#net.ipv6.conf.all.forwarding=1
#net.ipv6.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_source_route = 0
Example 3: I had added the DNS servers in /etc/network/interfaces.
dns-nameservers 9.9.9.9 8.8.8.8
It worked great. Then after a while, I realise I no longer have name resolution. I go back to my file, and the line is no longer there.
Okay, so by now, you'll think I'm crazy and I didn't edit the files on the right system. So, let me do it again.
cat /etc/network/interfaces
auto lo
iface lo inet loopback
wireless-power off
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.15
gateway 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
wpa-ssid "blah"
wpa-psk MYSECRET
Let's prove I don't have name resolution:
$ ping google.com
ping: unknown host google.com
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=21.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=20.2 ms
Now I edit /etc/network/interfaces to add the DNS servers:
$ sudo -s
[sudo] password for user:
root@wipi:/etc/apt/sources.list.d# vi /etc/network/interfaces
# grep dns /etc/network/interfaces
dns-nameservers 9.9.9.9 8.8.8.8
Now, I reboot to load the new configuration (I could do ifdown, ifup, true).
$ ssh user@192.168.0.15
Last login: Wed Dec 21 22:17:34 2016 from cray3.home
user@wipi ~ $
I do have name resolution:
$ ping google.com
PING google.com (216.58.210.206) 56(84) bytes of data.
64 bytes from mrs04s09-in-f206.1e100.net (216.58.210.206): icmp_seq=1 ttl=55 time=21.2 ms
64 bytes from mrs04s09-in-f206.1e100.net (216.58.210.206): icmp_seq=2 ttl=55 time=21.3 ms
Then, I try to refresh my source of packages with apt-get update. It doesn't work fully good because collabora isn't available.
W: Failed to fetch http://raspberrypi.collabora.com/dists/jessie/rpi/binary-armhf/Packages 404 Not Found [IP: 2a00:1098:0:82:1000:25:2eeb:e3e2 80]
So, I remove it:
$ sudo rm collabora.list
This time I get some other errors (see below).
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/main/binary-armhf/Packages Hash Sum mismatch
I also test I still have name resolution. This archive.raspberrypi.org is in raspi.list in my sources, so I remove raspi.list and re-update.
$ sudo rm raspi.list
$ sudo apt-get update
But it's worse and worse for apt-get update:
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/main/binary-armhf/Packages Hash Sum mismatch
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/non-free/binary-armhf/Packages Hash Sum mismatch
And now, I try to ping again, bam!! No name resolution:
$ ping google.com
ping: unknown host google.com
Sidenote:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 5.1G 9.0G 37% /
devtmpfs 87M 0 87M 0% /dev
tmpfs 91M 0 91M 0% /dev/shm
tmpfs 91M 8.5M 83M 10% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 91M 0 91M 0% /sys/fs/cgroup
/dev/mmcblk0p1 56M 21M 36M 38% /boot
tmpfs 19M 0 19M 0% /run/user/1001
$ mount
dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
...
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
$ uname -a
Linux wipi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
The system is on a SD card. No power issue. It gets the network via a Wifi dongle.
Thanks for any idea.