Skip to content

强制apt使用IPv4或IPv6 | xydche的博客 #1

@xydche

Description

@xydche

https://xydche.github.io/2018/04/24/%E5%BC%BA%E5%88%B6apt%E4%BD%BF%E7%94%A8IPv4%E6%88%96IPv6/

今天有个朋友新入的vps遇到不能使用apt,看了下是系统走IPv6总是连不上,按照以下方法解决,我记录下来,以备不时之需。此方法适用于debian与ubuntu。 如果只是临时使用,只需要像这样执行一条命令: 1apt -o Acquire::ForceIPv4=true update 如果想要默认以后都走IPv4的话,需要在/etc/apt/apt.conf.d文件夹下,创建一个99force

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions