Updating the system and git push is slow

Hi, i have been using PureOS for a while now and there is a problem i noticed. When i run
sudo apt update && sudo apt upgrade
in the terminal, it stops at
0% [Working]
for a nearly 5 seconds and then at
0% [Connecting to repo.pureos.net]
for nearly 4 more seconds before starting to update.

This problem did not exist in Ubuntu or Debian as i was using them before.

Also when i push some changes to a git repo, it takes a while to start pushing, nearly 10 seconds. I think there is a problem in sending the HTTP requests or making the connection to remote servers. Maybe PureOS has some additional checks that slows down the process. If anyone has an idea about whats happening or has the same problem please share your ideas.

Thank you

Hello! :wave:

I’m unable to reproduce this, but maybe we can figure it out on your end. :slight_smile:

Do you have those available to test in your network? Also, has this happened over a duration, or just upon first using PureOS? I ask because it reads like a network issue (which could still be OS-related).

Do you have those available to test in your network?

I think its not a network issue cuz i have tried other linux distros and its working fine. apt update and git push or pull are working fast with no these several seconds delay time. It is as the command freezes for a while at some point.

Also, has this happened over a duration, or just upon first using PureOS?

This problem had been happening since i installed PureOS till now, It is happening so far in apt update and git push or pull.

I have already tried other distros as main OS, will try some of them in a VM and update what happened.

I have tried ParrotOS and Ubuntu 21 in a virtual machine and both of them are having the same delay. I tried only sudo apt update. Maybe the problem is from the network as you said. This problem is not a big of an issue tho. I will try to figure out the reason for this delay behavior.

Strange delays at the beginning of a connection can be DNS problems. Can you add a host to your hosts file (temporarily) so that name resolution is not required and see whether the delay still happens?

1 Like

Yea that partially solved it. I added

138.201.228.45  repo.pureos.net
140.82.121.3    github.com

to /etc/hosts and now there is no delay at all in git push or pull.

Regarding sudo apt update, i told you that there was 2 delays. One in [0% [Working] and the other 0% [Connecting to repo.pureos.net]

The second 0% [Connecting to repo.pureos.net] was solved and there is no delay in it now. I tried adding and removing the IP Domain several times in the hosts file and it works.

But the first delay in [0% [Working] still exists.

Now how can fix that problem as its tedious to add every IP domain pair in the hosts file

I opened /etc/resolv.conf commented

#search local
#nameserver 192.168.1.1

and added those DNS servers

nameserver 1.1.1.1
nameserver 9.9.9.9

Now it works fine and everything is good. Thanks for help.

The next step in troubleshooting would be to comment out the entries in the hosts file (I did say it was temporary) and investigate the exact sequence of DNS servers that will be involved in resolving a host.

I note that repo.pureos.net appears to be on a relatively short TTL (300 seconds) so, a lot of the time, looking it up will require reaching the authoritative name server (rather than that it is resolved from a cache).

That’s not ideal from a privacy perspective.

Presumably 192.168.1.1 is your DHCP server handing itself out as the DNS server (should be a setting in your router if you don’t like that) and presumably the next hop in the DNS chain would be to contact your ISP’s DNS server.

Also, on my system, that file says “do not edit” because your edit will get wiped out after e.g. a reboot.

But, OK, if you are happy then go for it.

1 Like

As you said the /etc/resolv.conf gets overwritten everytime i reboot.

I tried to set the DNS from my rouer but it seems that i need the WAN username and password from my ISP to setup a manual DNS.

So as a temporary solution I did as instructed here by installing the package resolvconf and it now works fine.

1 Like