Score:-2

IP addresses of ubuntu servers which apt-get connects

to flag

My server uses Ubuntu 22.04 LTS. I have a very restricted firewall (UFW), that is, I have run these commands:

sudo ufw default deny outgoing
sudo ufw default deny incoming

But, I would like my system to be updated so, I need to enable only the necessary connections, that is, I need to allow the apt-get to connect to Ubuntu servers. Which are these servers and which are their IP addresses?

Score:1
in flag

We cannot tell you, as your sources might be different, depending on your mirror.

To find all IP addresses that you have configured in your sources, you can use a combination of grep and dig +short.

grep -Poh 'https?://\K[^:/ ]*' /etc/apt/sources.list /etc/apt/sources.list.d/*.list \
| xargs dig +short | sort -u
  • This needs a DNS Server to be available, so you need to allow connection to it in your firewall.

  • Note, that IP-addresses might change, so you may need to rerun that.

Rea K. avatar
to flag
I found the IP addresses and I allowed the connection. I also I allowed the connection to DNS but, sudo apt-get update still does not work..
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.