修改mysql配置文件vim commend not found 和安装vim -Temporary failure resolving 'deb.debian.org和'docker联网问题解决

4 篇文章 0 订阅
4 篇文章 0 订阅

这样要从开始mysql-binlog 说起了。
问题描述:
1 起因:修改docker容器mysql配置文件开启binlog实现canal微服务监听数据库的改变。发现指定/etc/mysql/my.cnf不能vim修改编辑,只能查看。
2 因为是在docker容器内,他就像个虚拟机,跟外界没有关联,要安装vim包才可以进行操作。如下命令
apt-get update
apt-get install vim
3 执行完报错如下:

Err:7 http://deb.debian.org/debian buster/main amd64 Packages
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:1a::645). - connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (151.101.110.133). - connect (111: Connection refused) [IP: 151.101.110.133 80]
Err:8 http://deb.debian.org/debian buster-updates/main amd64 Packages
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:1a::645). - connect (101: Network is unreachable) [IP: 151.101.110.133 80]
Fetched 458 kB in 7min 23s (1034 B/s)
Reading package lists… Done
W: Failed to fetch http://deb.debian.org/debian/dists/buster/main/binary-amd64/Packages Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:1a::645). - connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (151.101.110.133). - connect (111: Connection refused) [IP: 151.101.110.133 80]
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/main/binary-amd64/Packages Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:1a::645). - connect (101: Network is unreachable) [IP: 151.101.110.133 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

root@7ccd5ffbc1e1:/etc/mysql# apt-get install vim
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package vim 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 ‘vim’ has no installation candidate

4 apt-get update 报错失败是因为没有配置dns的原因

cd /etc/docker
touch daemon.json
添加
{
“dns”: [“8.8.8.8”, “114.114.114.114”]
}

重启服务
systemctl restart docker
重新执行2更新安装即可成功,如下:

root@7ccd5ffbc1e1:/etc/mysql# apt-get update
Hit:1 http://repo.mysql.com/apt/debian buster InRelease
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Hit:4 http://security.debian.org/debian-security buster/updates InRelease
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [7380 B]
Fetched 3480 kB in 18s (198 kB/s)
Reading package lists… Done
root@7ccd5ffbc1e1:/etc/mysql# apt-get install vim
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
vim-common vim-runtime xxd
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim vim-common vim-runtime xxd
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 7390 kB of archives.

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值