Welcome mate says you are not connected to internet

Hi everyone. I am newbie in Linux world. I have internet connection. firefox works without problem. But Welcome mate and software boutique say .
When I try sudo apt-get update, I the following error codes:

Err:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease          
  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
Err:2 http:/us.archive.ubuntu.com/ubuntu xenial-security InRelease 
  Unable to connect to localhost:4001:
Err:3 http:/archive.canonical.com/ubuntu xenial InRelease          
  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
Err:4 http:/archive.canonical.com xenial InRelease                 
  Unable to connect to localhost:4001:
Ign:5 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ InRelease
Err:6 http:/ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu xenial InRelease
  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
Err:7 http:/us.archive.ubuntu.com/ubuntu xenial-updates InRelease  
  Unable to connect to localhost:4001:
Ign:8 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Release
Ign:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
Ign:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
Ign:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
Ign:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
Ign:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
Ign:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
Ign:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
Ign:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
Ign:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
Ign:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
Ign:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
Ign:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
Ign:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
Ign:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
Ign:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
Ign:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
Ign:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
Ign:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
Ign:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
Ign:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
Err:9 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Sources
  Failed to connect to localhost port 4001: Connection refused
Err:10 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Packages
  Failed to connect to localhost port 4001: Connection refused
Err:11 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en_US
  Failed to connect to localhost port 4001: Connection refused
Err:12 https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Translation-en
  Failed to connect to localhost port 4001: Connection refused
Reading package lists... Done
W: The repository 'https:/<my.favorite.cran.mirror>/bin/linux/ubuntu xenial/ Release' does not have a Release file.
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: Failed to fetch http:/us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http:/archive.canonical.com/ubuntu/dists/xenial/InRelease  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http:/us.archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Unable to connect to localhost:4001:
W: Failed to fetch http:/archive.canonical.com/dists/xenial/InRelease  Unable to connect to localhost:4001:
W: Failed to fetch http:/us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to localhost:4001:
W: Failed to fetch http:/ppa.launchpad.net/ubuntu-mate-dev/welcome/ubuntu/dists/xenial/InRelease  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch https:/<my.favorite.cran.mirror>/bin/linux/ubuntu/xenial/Sources  Failed to connect to localhost port 4001: Connection refused
W: Failed to fetch https:/<my.favorite.cran.mirror>/bin/linux/ubuntu/xenial/Packages  Failed to connect to localhost port 4001: Connection refused
W: Failed to fetch https:/<my.favorite.cran.mirror>/bin/linux/ubuntu/xenial/en_US  Failed to connect to localhost port 4001: Connection refused
W: Failed to fetch https:/<my.favorite.cran.mirror>/bin/linux/ubuntu/xenial/en  Failed to connect to localhost port 4001: Connection refused
W: Some index files failed to download. They have been ignored, or old ones used instead.

How can I fix this? Thanks in advance.

Hi @MohammadB,

try changing your software sources download location to “Main Server” per the update guide and try updating again!:

Are you able to access the internet normally? Something looks wrong as it’s trying to connect to itself (localhost).

Welcome/Software Boutique tries to connect to http://archive.ubuntu.com, if this is not working, then it assumes there isn’t a connection and displays that message.

If your connection works, but Welcome/Boutique still complains, you can bypass by pressing ALT + F2 and running this command:

ubuntu-mate-welcome --force-no-net