ubuntu 16.04执行apt-get update失败卡住的解决方法

luder@ubuntu:~$ sudo apt update
0% [Connecting to us.archive.ubuntu.com (2001:67c:1562::19)] [Connecting to sec^C

打开/etc/gai.conf

找到

#precedence ::ffff:0:0/96  100

把前面的"#"去掉即可。

# precedence  <mask>   <value>
#    Add another rule to the RFC 3484 precedence table.  See section 2.1
#    and 10.3 in RFC 3484.  The default is:
#
#precedence  ::1/128       50
#precedence  ::/0          40
#precedence  2002::/16     30
#precedence ::/96          20
#precedence ::ffff:0:0/96  10
#
#    For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96  100

#
# scopev4  <mask>  <value>

再次执行  apt-get update 就没有问题了。

### 如何安装 Weave Scope 容器监控工具 Weave Scope 是一种用于 Docker 和 Kubernetes 集群可视化监控的工具,能够帮助用户快速了解集群的状态并提供故障排查的支持。以下是具体的安装方法: #### 单机环境下的安装 可以通过以下命令下载并安装 Weave Scope 工具到 `/usr/local/bin` 目录下[^5]。 ```bash curl -L https://github.com/weaveworks/scope/releases/download/latest_release/scope -o /usr/local/bin/scope chmod a+x /usr(local)/bin/scope ``` 完成上述操作后,可以启动 Weave Scope 来开始监控本地运行的容器。通过执行 `scope launch` 命令即可开启服务[^4]。 #### 多节点环境中的安装 如果需要在多台机器组成的分布式环境中使用 Weave Scope,则需按照如下方式进行配置: 1. 在每台目标服务器上重复单机版的安装过程; 2. 使用特定参数指定应用范围或连接其他节点形成网络拓扑图显示整个系统的交互情况[^3]。 以上步骤完成后访问默认地址 http://<server-ip>:4040 就可以看到图形界面展示出来的各项指标数据了[^1]。 ```python import subprocess def install_weave_scope(): try: download_command = 'curl -L https://github.com/weaveworks/scope/releases/download/latest_release/scope -o /usr/local/bin/scope' permission_command = 'chmod a+x /usr/local/bin/scope' subprocess.run(download_command, shell=True, check=True) subprocess.run(permission_command, shell=True, check=True) print("Installation successful.") except Exception as e: print(f"An error occurred during installation: {e}") install_weave_scope() ```
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

路边闲人2

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值