winget installation prompt: An unexpected error occurred while executing this command: InternetOpenUrl() failed. 0x80072efd

question:

When we use Wingetthe package manager to install software, we always get the following error.

执行此命令时发生意外错误:
InternetOpenUrl() failed.
0x80072efd : unknown error

Insert image description here

Solution:

DNS is an important tool for converting web addresses into IP addresses. If your computer cannot access GitHub, it is most likely due to a DNS failure. Methods to solve such problems include modifying the DNS server, using a DNS service provider that can prevent DNS pollution, or using a VPN to avoid DNS resolution problems.

At this time, you only need to modify the host file and write the accessible dns resolution address.

Steps

  • Adding to the hosts file can resolve the IP normally.

Execute the CMD command line with administrator rights and enter the following command:

echo 20.205.243.166 github.com >> c:\Windows\System32\drivers\etc\hosts
echo 199.232.5.194 github.global.ssl.fastly.net  >> c:\Windows\System32\drivers\etc\hosts
echo 151.101.100.133 raw.githubusercontent.com  >> c:\Windows\System32\drivers\etc\hosts
  • Flush dns cache
ipconfig/flushdns

Install the application using Winget command

wingetAt this point , you can install the application normally through

Insert image description here

Guess you like

Origin blog.csdn.net/no1xium/article/details/133126080