カフェのネットワークを使って作業をしており、` sudo apt-get install python3-pip`
を実行したのですが、以下エラーが出てしまいます。

```

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package python3-pip is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    
    E: Package 'python3-pip' has no installation candidate
    
```

そこで、

```

    sudo apt update
    sudo apt upgrade
    
```

をすると良いと聞き、実行したのですが、

```

    ~$ sudo apt update
    Err:1 http://archive.ubuntu.com/ubuntu focal InRelease                                                          
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
    Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                  
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    Err:4 http://archive.ubuntu.com/ubuntu bionic InRelease        
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    Err:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    Err:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
      Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    Err:7 http://security.ubuntu.com/ubuntu focal-security InRelease
      Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out
    Reading package lists... Done                                  
    Building dependency tree       
    Reading state information... Done
    All packages are up to date.
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.152), connection timed out
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (101: Network is unreachable)
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    
```

のようにエラーが出てしまい、

```

    sudo apt upgrade
    
```

をして、

```

    sudo apt-get install python3-pip
    
```

をしても上記のエラーと同様のエラーが出てしまします。  
どうすれば改善できるでしょうか？  
お願い致します。
CC BY-SA 4.0
2021-12-10T08:17:01.977
84050
2021-12-14T01:42:37.113
2021-12-14T01:42:37.113
3060
49404
question
ubuntu apt
apt コマンド実行時にネットワーク接続がタイムアウトしてしまう
解決しましたので報告させて頂きます。

コメント頂いた、[cubick](https://ja.stackoverflow.com/users/3060/cubick)さん、[oriri](https://ja.stackoverflow.com/users/43025/oriri)さん、ありがとうございました。  
コメントではリンクとページの名称を間違えて打ってしまっていたのですが、正確には、  
"[apt-get update failed on
WSL2](https://stackoverflow.com/questions/60777927/apt-get-update-failed-on-
wsl2)の通り"でした。

如何にして「sudo apt-get install python3-pipをしたい。ubuntu: sudo apt
update時にエラーが出る」が解消したかを申しますと、[apt-get update failed on
WSL2](https://stackoverflow.com/questions/60777927/apt-get-update-failed-on-
wsl2)にある通り、当方のPCでアンチウィルスソフトのAvastが働いており、Avastの設定で、プロテクションの設定に行き、該当する「現在のネットワーク」の「設定を表示」に進み、  
「このネットワークを信頼していません(パブリック)」から「このネットワークを信頼しています(プライベート)」に変更することで解決致しました。

[![プロテクションの設定](https://i.stack.imgur.com/5M4GW.jpg)](https://i.stack.imgur.com/5M4GW.jpg)

無事

```

    sudo apt update
    sudo apt upgrade
    sudo apt-get install python3-pip
    
```

を実行でき、pipがインストールされました。  
[![インストールされたpip](https://i.stack.imgur.com/hehnm.jpg)](https://i.stack.imgur.com/hehnm.jpg)

ありがとうございました。
CC BY-SA 4.0
2021-12-11T08:05:28.063
84064
2021-12-11T08:05:28.063
49404
84050
answer