Linux 下 Chrome 浏览器一直报“检测到网络变化”，修复方法来了
Chromium Chrome 浏览器
![](/data/attachment/album/202105/14/140644y6xx6e8100wzxrr5.jpg)


过去几天，我在 Ubuntu Linux系统上遇到了一个奇怪的问题。我用的是 Firefox 浏览器和 [Brave 浏览器](https://itsfoss.com/brave-web-browser/)。Brave 浏览器一直报“network change detection”错误，几乎每次刷新都报错，但是在 Firefox 浏览器中一切正常。


![](/data/attachment/album/202105/14/141032n6ddr2bpv7cnd6dd.png)


这个问题严重到了几乎不能使用浏览器的地步。我不能用 [Feedly](https://feedly.com/) 来从我最喜欢的网站浏览信息流，每一个搜索结果都要多次刷新，网站也需要多次刷新。


作为替代，我尝试 [在 Ubuntu 上安装 Chrome 浏览器](https://itsfoss.com/install-chrome-ubuntu/)。但是问题依然存在。我还 [在 Linux 上安装了微软 Edge](https://itsfoss.com/microsoft-edge-linux/)，但是问题依旧。基本上，任何 Chromium 内核的浏览器都会持续报“ERR\_NETWORK\_CHANGED”错误。


幸运地是，我找到了一个方法来修复这个问题。我将会把解决步骤分享给你，如果你也遇到了同样的问题，这将能够帮到你。


### 解决基于 Chromium 内核的浏览器频繁报“network change detection”错的问题


对我而言，关闭网络设置中的 IPv6 是一个有效的诀窍。虽然现在我还不确定是什么导致了这个故障，但是 IPv6 会在很多系统中导致错误并不是什么鲜为人知的事。如果你的系统，路由器和其他设备用了 IPv6 而不是古老却好用的 IPv4，那么你就可能遭遇和我相同的网络连接故障。


幸亏，[关闭 Ubuntu 的 IPv6](https://itsfoss.com/disable-ipv6-ubuntu-linux/) 并不算难。有好几种方法都能够达到目的，我将会分享一个大概是最容易的方法。这个方法就是用 GRUB 来关闭 IPv6。



> 
> 新手注意！
> 
> 
> 如果你不习惯于用命令行和终端，请额外注意这些步骤。仔细的阅读这些操作说明。
> 
> 
> 


#### 第 1 步：打开 GRUB 配置文件以编辑


打开终端。用下面的命令来在 Nano 编辑器中打开 GRUB 配置文件。这里你需要输入你的账户密码。



```
sudo nano /etc/default/grub

```

我希望你懂得一点 [使用 Nano 编辑器](https://itsfoss.com/nano-editor-guide/) 的方法。使用方向键移动光标，找到以`GRUB_CMDLINE_LINUX` 开头的这行。把它的值修改成这样：



```
GRUB_CMDLINE_LINUX="ipv6.disable=1"

```

注意引号和空格。不要动其他行。


![](/data/attachment/album/202105/14/141032dv9qvop17hp1dhdd.png)


使用 `Ctrl+x` 快捷键保存更改。按 `Y` 或者回车确认。


#### 第 2 步：更新 GRUB


你已经修改了 GRUB 引导器的配置，但是在你更新 GRUB 之前这些更改都不会生效。使用下面的命令来更新：



```
sudo update-grub

```

![](/data/attachment/album/202105/14/141033c1ogwg05ogsw5s30.png)


现在当你重启系统之后，IPv6 将会被关闭了。你不应该再遇到网络中断的故障了。


你可能会想为什么我没提从网络设置中关掉 IPv6。这是因为目前 Ubuntu 用了 [Netplan](https://netplan.io/) 来管理网络配置，似乎在网络设置中做出的更改并没有被完全应用到 Netplan 中。我试过虽然在网络设置中关掉了 IPv6，但是这个问题并没有被解决，直到我用了上述命令行的方法。


即使过了这么多年，IPv6 的支持还是没有成熟，并且持续引发了很多故障。比如关闭 IPv6 有时候能 [提高 Linux 下的 Wi-Fi 速度](https://itsfoss.com/speed-up-slow-wifi-connection-ubuntu/)。够扯吧？


不管怎样，我希望上述小方法也能够帮助你解决系统中的“network change detection”故障。




---


via: <https://itsfoss.com/network-change-detected/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[HuengchI](https://github.com/HuengchI) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
For the past several days, I faced a strange issue in my system running Ubuntu Linux. I use Firefox and [Brave browsers](https://itsfoss.com/brave-web-browser/). Everything was normal in Firefox but Brave keeps on detecting a network change on almost every refresh.

![network change detected with error ERR_NETWORK_CHANGED](https://itsfoss.com/content/images/wordpress/2021/04/network-change-detected-800x418.png)

This went on to the extent that it became impossible to use the browser. I could not use [Feedly](https://feedly.com/) to browse feeds from my favorite websites, every search result ends in multiple refresh, websites needed to be refreshed multiple times as well.

As an alternative, I tried [installing Chrome on Ubuntu](https://itsfoss.com/install-chrome-ubuntu/). The problem remained the same. I [installed Microsoft Edge on Linux](https://itsfoss.com/microsoft-edge-linux/) and yet, the problem persisted there as well. Basically, any Chromium-based browser keep encountering the ERR_NETWORK_CHANGED error.

Luckily, I found a way to fix the issue. I am going to share the steps with you so that it helps you if you are also facing the same problem.

## Fixing frequent network change detection issues in Chromium based browsers

The trick that worked for me was to disable IPv6 in the network settings. Now, I am not sure why this happens but I know that IPv6 is known to create network problems in many systems. If your system, router and other devices use IPv6 instead of the good old IPv4, you may encounter network connection issues like the one I encountered.

Thankfully, it is not that difficult to [disable IPv6 in Ubuntu](https://itsfoss.com/disable-ipv6-ubuntu-linux/). There are several ways to do that and I am going to share the easiest method perhaps. This method uses GRUB to disable IPv6.

Attention Beginners!

If you are not too comfortable with the command line and terminal, please pay extra attention on the steps. Read the instructions carefully.

### Step 1: Open GRUB config file for editing

Open the terminal. Now use the following command to edit the GRUB config file in Nano editor. You’ll have to enter your account’s password.

`sudo nano /etc/default/grub`


I hope you know a little bit about [using Nano editor](https://itsfoss.com/nano-editor-guide/). Use the arrow keys to go to the line starting with GRUB_CMDLINE_LINUX. Make its value look like this:

`GRUB_CMDLINE_LINUX="ipv6.disable=1"`


Be careful of the inverted commas and spaces. Don’t touch other lines.

![Disabling IPv6 via GRUB](https://itsfoss.com/content/images/wordpress/2021/04/disabling-ipv6-via-grub-800x453.png)

Save your changes by using the Ctrl+x keys. It will ask you to confirm the changes. Press Y or enter when asked.

### Step 2: Update grub

You have made changes to the GRUB bootloader configuration. These changes won’t be taken into account until you update grub. Use the command below for that:

`sudo update-grub`


![updating grub ubuntu](https://itsfoss.com/content/images/wordpress/2021/04/updating-grub-ubuntu-800x434.png)

Now when you restart your system, IPv6 will be disabled for your networks. You should not encounter the network interruption issue anymore.

You may think why I didn’t mention disabling IPv6 from the network settings. It’s because Ubuntu uses [Netplan](https://netplan.io/) to manage network configuration these days and it seems that changes in Network Manager are not fully taken into account by Netplan. I tried it but despite IPv6 being disabled in the Network Manager, the problem didn’t go away until I used the command line method.

Even after so many years, IPv6 support has not matured and it keeps causing trouble. Disabling IPv6 sometimes [improve WiFi speed in Linux](https://itsfoss.com/speed-up-slow-wifi-connection-ubuntu/). Weird, I know.

Anyway, I hope this trick helps you with the network change detection issue in your system as well.