I wrote a simple bash script to keep my system updated, and put it on a crontab to execute @reboot:
(sudo apt-get update) >> /home/raphael/Documents/Logs/updateLogs.txt
(sudo apt-get upgrade -y) >> /home/raphael/Documents/Logs/updateLogs.txt
(sudo apt autoremove -y) >> /home/raphael/Documents/Logs/updateLogs.txt
(sudo date ) >> /home/raphael/Documents/Logs/updateLogs.txt
However, every time I check the updateLogs.txt
file I encounter these errors:
Err:1 http://packages.microsoft.com/repos/vscode stable InRelease
Temporary failure resolving 'packages.microsoft.com'
Err:2 http://br.archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'br.archive.ubuntu.com'
Err:3 http://br.archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'br.archive.ubuntu.com'
Err:4 http://br.archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'br.archive.ubuntu.com'
Err:5 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:6 http://packages.elementary.io/appcenter xenial InRelease
Temporary failure resolving 'packages.elementary.io'
Err:7 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:8 http://ppa.launchpad.net/elementary-os/stable/ubuntu xenial InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:9 http://ppa.launchpad.net/papirus/papirus/ubuntu xenial InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:10 http://ppa.launchpad.net/elementary-os/os-patches/ubuntu xenial InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:11 http://dl.google.com/linux/chrome/deb stable InRelease
Temporary failure resolving 'dl.google.com'
Err:12 http://repository.spotify.com stable InRelease
Temporary failure resolving 'repository.spotify.com'
If I run manually the script I get the expected results:
Hit:1 http://br.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://br.archive.ubuntu.com/ubuntu xenial-updates InRelease
Get:3 http://br.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://repository.spotify.com stable InRelease
Hit:6 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Hit:7 http://dl.google.com/linux/chrome/deb stable Release
Hit:8 http://packages.microsoft.com/repos/vscode stable InRelease
Hit:10 http://ppa.launchpad.net/elementary-os/stable/ubuntu xenial InRelease
Hit:11 http://ppa.launchpad.net/papirus/papirus/ubuntu xenial InRelease
Hit:12 http://ppa.launchpad.net/elementary-os/os-patches/ubuntu xenial InRelease
Hit:13 http://packages.elementary.io/appcenter xenial InRelease
Get:14 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Fetched 204 kB in 5s (38,6 kB/s)
At first I thought it was a wi-fi problem, so I put an Ethernet cable in my notebook, but I got the same results. Any thoughts on why this happens?