【环境设置】debian update失败

症状

之前一直使用的debian环境,今天突然aptitude update失败,错误信息如下:

root@ Tue Oct 28 20:26:35 ~
$  aptitude update
Err http://mirrors.163.com wheezy Release.gpg
  Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com wheezy-proposed-updates Release.gpg
  Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com wheezy-updates Release.gpg
  Could not resolve 'mirrors.163.com'
Err http://mirrors.163.com wheezy/updates Release.gpg
  Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/debian/dists/wheezy/Release.gpg: Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/debian/dists/wheezy-proposed-updates/Release.gpg: Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/debian/dists/wheezy-updates/Release.gpg: Could not resolve 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/debian-security/dists/wheezy/updates/Release.gpg: Could not resolve 'mirrors.163.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

但网络是通的:

root@ Tue Oct 28 20:31:54 ~
$   ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=2 ttl=128 time=37.5 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=128 time=45.9 ms
64 bytes from 8.8.8.8: icmp_req=4 ttl=128 time=36.9 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3010ms
rtt min/avg/max/mdev = 36.975/40.156/45.922/4.084 ms

root@ Tue Oct 28 20:39:38 ~
$  
环境说明

系统版本:

root@ Mon Oct 27 17:10:30 /usr/share/vim/vim73/colors
$  uname -a Linux Ulric 3.2.0-4-686-pae #1 SMP Debian 3.2.63-2 i686 GNU/Linux

软件源

root@ Tue Oct 28 20:26:45 ~
$   cat /etc/apt/sources.list
#deb http://ftp.debian.org/debian wheezy main contrib non-free
#deb-src http://ftp.debian.org/debian wheezy main contrib non-free

deb http://mirrors.163.com/debian wheezy main non-free contrib  
deb-src http://mirrors.163.com/debian wheezy main non-free contrib  
deb http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free  
deb-src http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free  
deb http://mirrors.163.com/debian wheezy-updates main contrib non-free  
deb-src http://mirrors.163.com/debian wheezy-updates main contrib non-free  
deb http://mirrors.163.com/debian-security wheezy/updates main contrib non-free   
deb-src http://mirrors.163.com/debian-security wheezy/updates main contrib non-free  
解决方案:

经过baidu的帮助,终于找到原因了:

http://tieba.baidu.com/p/2110278694

今天早上开了EasyConnect(http://baike.baidu.com/view/6614495.htm?fr=aladdin),用来跳转到其它服务器。个人猜测是代理导致本地的公钥验证失败,从而导致update失败。

把EasyConnect关闭后,就顺利update了。

转载于:https://www.cnblogs.com/sslizy/p/4058662.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ansible是一个强大的自动化运维工具,它可以用来配置和管理服务器。如果你想要在服务器启动时自动运行Ansible任务,通常会涉及到配置服务或守护进程。以下是使用Ansible设置开机自启的基本步骤: 1. **在主机上安装必要的软件**: 首先确保目标服务器上已经安装了Ansible和SSH(因为Ansible通常是通过SSH执行操作的)。如果需要,可以通过包管理器如apt、yum或zypper安装它们。 2. **编写Ansible playbook**: 创建一个YAML格式的playbook,其中包含`service`模块来管理服务。例如,你可以创建一个名为`setup.yml`的文件,内容可能像这样: ```yaml --- - name: Install and enable ansible service hosts: localhost become: yes tasks: - name: Add ansible to startup apt: name: ansible state: present update_cache: yes when: ansible_os_family == 'Debian' - name: Enable ansible service on Red Hat family systemd: name: ansible enabled: yes state: started when: ansible_os_family == 'RedHat' ``` 这里假设你的服务器是Debian或Red Hat家族系统,根据实际的环境调整。 3. **配置服务为开机自启**: playbook中的`systemd`模块在Red Hat家族中用于设置服务为开机自启,对于Debian系统则可能需要使用`rc.local`文件或`systemd-analyze`工具。 4. **运行Ansible playbook并设置开机自启**: 使用`ansible-playbook`命令运行这个playbook,确保你有权限连接到目标机器并执行操作: ``` ansible-playbook -i <inventory_file> setup.yml ``` 为了设置服务为开机自启,你可以将上述playbook添加到`/etc/rc.local`(Debian)或`/etc/systemd/system/multi-user.target.wants/your_service_name.service`(Red Hat)文件中,并确保服务已经启用。 **相关问题--:** 1. Ansible的inventory文件是什么,怎么配置? 2. 如何检查Ansible是否成功设置了服务开机自启? 3. 如果Ansible操作失败,应该查看哪些日志来调试?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值