Score:0

403 error on sudo apt-get update

in flag

For months I could not figure out why I couldn't update, so I just left it alone.

Then one day when I was installing Ubuntu desktop on my windows computer, I ran into the same problem. Both my linux and windows computer are connected to the internet through an ethernet chord. So the fact that I got the same error on my other computer made me think it was a IP issue. So I switched my connection (on my windows) from ethernet to wifi and it worked.

Unfortunately on my linux, I do not have a wifi adapter. It won't let me install one either.

Why is that I can sudo apt-get update when connected through the wifi but not ethernet?

sources.list

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner

error:

Err:1 http://packages.ros.org/ros/ubuntu focal InRelease
  403  Forbidden: header 'Content-Type' value denied [IP: 140.211.166.134 80]
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                       
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease                                      
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.91.38 80]
Hit:4 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease                                
Err:5 http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu focal InRelease                 
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
Err:6 http://archive.ubuntu.com/ubuntu focal InRelease                                         
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.88.152 80]
Hit:7 https://dl.google.com/linux/chrome/deb stable InRelease                                    
Err:8 http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu focal InRelease
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
Err:9 http://archive.ubuntu.com/ubuntu focal-updates InRelease           
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.88.152 80]
Err:10 http://ppa.launchpad.net/rock-core/qt4/ubuntu focal InRelease     
  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://packages.ros.org/ros/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/focal/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 140.211.166.134 80]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.91.38 80]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu/dists/focal/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://archive.ubuntu.com/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.88.152 80]
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu/dists/focal/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.88.152 80]
E: The repository 'http://archive.ubuntu.com/ubuntu focal-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.
E: Failed to fetch http://ppa.launchpad.net/rock-core/qt4/ubuntu/dists/focal/InRelease  403  Forbidden: header 'Content-Type' value denied [IP: 91.189.95.85 80]
E: The repository 'http://ppa.launchpad.net/rock-core/qt4/ubuntu focal 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.
ru flag
We need the entire error, so if you are getting 403s we can't see them here - we'll really need to see the errors you're seeing to really diagnose what's up. It's possible there is some kind of firewall in place on your network that changes what you can and can't access based on wifi or ethernet access. Is this in a workplace?
jake avatar
in flag
@ThomasWard sorry, i added that now. Yes, to your last question.
ru flag
if this is on a corporate network chances are you have **WILDLY** different rules between Ethernet (wired internal corporate network) and Wifi (which is likely not as restricted because of Bring Your Own Device needs). Your next step for getting support with this is your workplace IT team, they probably won't let you connect a device they don't manage to the Ethernet. (speaking from experience since I enact the same policies at my FT job since i'm the Network Security guy at the office)
Score:1
ru flag

It sounds like you have a problem where the Ethernet network is configured to be restrictive, filtering all your traffic and disallowing traffic to destinations that are not permitted.

This means either a web proxy is in play, or the Ethernet network is restricted.

UNFORTUNATELY, as you state in response to my inquiry via comments, this is a workplace network you are talking about, so you can't just go plugging things into your corporate network and expect things to work. (Proper) Workplace network security doesn't work that way, and the wifi is likely connected to a guest network segregated from corporate stuff versus the corporate ethernet which has a lot more control of what it can or can't access (such as going to the Internet, and therefore putting instant 403 restrictions as your device is not allowed out; the concept of Bring Your Own Devices lends itself to having a wifi network that is segregated from Corporate items so you can't access corporate from wifi directly, instead having to traverse to the Internet to then reach back to things like work email, etc. via separate IPs and connections, and that similarly Corporate can't access devices on the wifi.).

The only solution here that will let you not violate corporate usage policies (and chances are there is an Acceptable Use Policy on your network) is to talk to your workplace IT team - those are the only people who can help because of the way business / corporate networks are built - the IT team and the Security Team at your employer hold the keys, so only they can help you.

(Chances are, though, they won't let a device they don't control onto the Ethernet network in a way that would work for you - this is typical IT Security policy at most businesses that have security teams.)

Score:0
io flag

This fixed it for me:

sed -i s/http/ftp/ /etc/apt/sources.list && apt-get update

http was forbidden, but ftp was allowed, thus making the connection to the repository. This could be restricted from Ubuntu side. I did not have to do anything on my side, no firewall running or restrictions.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.