Score:0

How to debug a Error while refreshing cache: pk-client-error-quark

lv flag

Couple of days having this issue. On Ubuntu 22.10, tried to use apt-get, update or install, and get the following warning:

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/kinetic/InRelease  Could not connect to 127.0.0.1:58591 (127.0.0.1). - connect (111: Connection refused)

Be aware the error msg says "Could not connect to 127.0.0.1:58591" which makes me think there are some kind of proxy in the system that is redirecting this traffic and trying to link an unexistent address. However I used the command env and echo $http_proxy (and https, socks etc) but everything seems to be clear. No proxys setted at all.

As a one more context fact, I normally use some vpn clients. One is OpenConnect with Gnome GUI, and other is Trojan in the command line to connect Shadowsocks server, using 127.0.0.1:1080 as its port. And recently I'm using a Shadowsocks VPN running in my router, however I think this one is out of scope. The thing is all the other internet services in the machine are working as expected!

I'll be so thankful is someone can share any way to debug this, till now I'm clueless :(

Score:0
ng flag

Seeing as you're in China, I would think it's better to use a mirror located within the same country. I have not seen such an error message, but the connection refused might indicate that the firewall blocked that connection attempt.

There's a list of mirrors on LaunchPad: https://launchpad.net/ubuntu/+archivemirrors

But you can try and set the URLs directly to use a Nanjing University's eScience Center's mirror, like:

deb https://mirror.nju.edu.cn/ubuntu/ kinetic main

Once you have replaced it for all components (main, restricted, universe and multiverse) and the relevant updates and possibly backports (if you use them), try to update the cache by issuing:

sudo apt-get update

...and see whether that makes a difference.

Henry Corredor avatar
lv flag
thanks for your early reply! I have tried many different URL, not only Chinese servers but many others. Before I used to use one server in México because my VPN pointed there and somehow it worked quite well. All of them gives error "Could not connect".
Henry Corredor avatar
lv flag
I just edited my original post with things that I just realized a moment ago. Look at the fealure message, showing the address that is trying to load is not the URL of the repo but a localhost IP port 58591, which as far as I understand is not the regular way to proceed...
Janne Jokitalo avatar
ng flag
Yes, it certainly feels so. If you issue a command `sudo netstat -tulpn` you should see what is listening to which port. Maybe that can guide you forward.
Henry Corredor avatar
lv flag
oh wow this is quite enlightening! I noticed that I have several Docker ports open that I don't use anymore from the last year lol . Actually I found the problem in the apt.conf file! I added previously a proxy configuration in there. Just removed the proxy and now everything works. Now my question is, how can I close this post properly? Thanks so much for your answers! Mr. Janne I'll buy you a coffee if I could :)
Janne Jokitalo avatar
ng flag
Glad to hear it was useful. :) The port is open but there's something listening only if a service is up and running. So you need to figure out what program you installed for the proxy service, and remove that.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.