Does anyone how to change the default behavior of APT on Elementary OS? APT seemingly picks a random mirror to download each package from which, in theory, sounds like a great idea but in practice you wind up with a mirror that’s really slow holding up the install/update process to download at 40kb/sec
Ideally, I’d like to be able to pick my mirror manually or use something like regular old Ubuntu’s tool to pick the fastest mirror.
My research on this comes up pretty empty. Maybe I’m just not Googling right or no one else gets annoyed by this. So far all I’ve come up with is that APT is using a mirror:// file but I haven’t gotten much further than that.
Thanks,
Dan
PS: I put this in Ubuntu as Elementary OS is based on Ubuntu. I wasn’t able to add a tag for Elementary OS. Are regular members not allowed to make new tags?
as your topic seems interesting I´d like to know the solution to that as well.
Yet I´m not using elemntartyOS myself so I did some research on the matter (I also asked ChatGPT about that).
I couldn´t verify the results myself so you might have to take the instructions with a grain of salt.
elementaryOS is based on Ubuntu, so many of the package management tools and configurations are similar. To change the default behavior of APT (Advanced Package Tool) and select a specific mirror for package downloads, you can follow these steps:
Backup Your System … before making any changes
Edit APT Configuration:
Open a terminal and run the following command to open the APT configuration file in a text editor with administrative privileges:
sudo nano /etc/apt/sources.list
Select a Mirror:
In the text editor, you’ll see a list of URLs that point to various mirrors. Each line represents a repository source. You can manually choose a mirror by replacing the default mirror URLs with the URL of the mirror you want to use.
For example:
deb http://example.mirror.univ-xyz.edu/ubuntu/ bionic main
deb-src http://example.mirror.univ-xyz.edu/ubuntu/ bionic main
You can find a list of Ubuntu mirrors here: Mirrors : Ubuntu #this seems to be the interesting part
Update APT:
After editing the sources list, save the file and exit the text editor. Then, update the package information by running the following command:
sudo apt update
Upgrade Packages (Optional):
If you want to upgrade your packages, you can run:
sudo apt upgrade
Please note that while this approach should work in many cases, there’s always a possibility that manual mirror selection might not yield the expected results due to changes on the mirror’s end or potential network issues.
Also, keep in mind that elementaryOS might have its own unique configuration or utilities for managing mirrors, so you might want to consult the elementaryOS documentation or community for specific guidance tailored to that distribution.
A window opens with a list of all mirrors and gradually shows the transfer speed of each one. I can select sort on the Speed column and choose the mirror with the fastest transfer speed:
I Select the mirror you want to use and press the Apply button
Note: I’ve had problems selecting other mirrors because, for example, they’re either slower than they were when I chose them, they’re down or they have problems updating packages, which is why I tend to use the main “official mirrors” (I don’t know what to call them).
Thanks guys. I didn’t mean to post and run without updating. I installed Elementary OS as my 3rd OS on my desktop. I’m going to try and take a video of the update process to show you guys what I mean.