A solution to err: 34 connection failed during Ubuntu apt install

Time:2022-5-9

During the recent report, some students reported that something happened when Ubuntu installed the softwareErr: 34 Connection failedWrong words, look at the information that prompts the error. It’s obvious: network error.

Look at the detailed information, it’s actually downloadinghttp://cn.archive.ubuntu.com/xxxAn error occurred while accessing resources on. At that time, I felt that this error should not occur. Look, the prefix iscn, the server should be in China, so it should not be a network error, so it is suspected that it should be the source of the problem in the process of software installation.

Today, when solving a strange error caused by development environment problems, vnc service was pre installed, and a similar error occurred. The solution is as follows:

Confirm the problem

Since we are prompted that it is a network problem, the first thing to do is to confirm whether it is really a network problem. We can copy the wrong address according to the prompt of err: 34, and then open it with the browser. If it can be downloaded successfully, it indicates that there is no problem with the network (please check whether the agent is set for apt at this time. If the agent is set, the information of the agent is still correct). If it cannot be opened, it indicates that there is indeed a problem with the network.

solve the problem

There are generally two kinds of grid problems: one is its own network problem. 2. Server network problem. Enable the proxy in the browser and revisit the error reporting address. If it can be opened, it indicates that it is your own grid problem; If the browser still cannot be opened after the agent is enabled, it indicates that it is a server problem.

Own network problems

For your own network problems, you only need to set up an agent for apt. for example, the information of the agent available to us is:http://127.0.0.1:7890, you can operate as follows.

$ sudo vi /etc/apt/apt.conf

Then enter the following:

Acquire::http::Proxy "http://127.0.0.1:7890";

Note to replace with your own proxy address.

Then re executeapt installAll right

Network problems with the server

If there is a network problem with the server, you should try toapt installAdd a new source. Since the author has not encountered the corresponding problem, the solution is not nonsense here. Please search for it yourself.

Recommended Today

In order to let beginners have projects to get started, I sorted out these 23 open source projects

Author: Miguel NunezTranslator: front end XiaozhiSource: dev Dream, dry goods, wechat search[move to the world]Pay attention to this dish brushing wisdom who is still doing dishes in the early morning. This article GitHubhttps://github.com/qq449245884/xiaozhiIt has been included. There are complete test sites, materials and my series of articles for the interview of front-line large factories. Many […]