Slow wifi speed

Hello, I have installed the image on my raspberry pi 4, then I entered the command into the terminal “sudo pifi add mywifiname password”, rebooted, now my wifi is working but the internet speed is very low, when I ran “sudo apt get update” the speed was in the range from 100 b / s to 300 Kb / s sometimes it is interrupted altogether although I have very good internet and it works fast on my computer … I do not want to connect to the raspberry pi via ssh, or use it as a hotspot, I just want a raspberry pi with ubuntu ros and a working internet. Also during sudo apt get upgrade i got "Failed to fetch https: //ports.ubuntu.com … (101: Network is unreachable)

Hi @danqwert

First off I would check to make sure that the Pi is not on top of anything metal that may interfere with wifi signals, and that the signal strength of the wifi is good. The wifi system on the Pi is not the best, and often does poorly even where other devices are fine.

In general the ports.ubuntu.com server is often stupidly slow, even over a very good hardwired internet connection. It might help if you replace ports.ubuntu.com with https://mirrors.mit.edu/ubuntu-ports/ (a mirror hosted by MiT) in /etc/apt/sources.list.

Rohan