Should I use apt-get, apt, or apt-fast ?

ยท 1159 words ยท 6 minute read

I use Ubuntu 24.04 LTS as my daily driver for personal use and my software development job. I like to update all my programs and packages daily. I want to use the fastest programming interface to update and upgrade my installed packages/programs.

I can use apt-get, or apt, or apt-fast.. but is there a real difference in speed and performance between them?

Let’s test them.

I used time program available on Ubuntu Linux by default. The following benchmarks are on my own laptop with my home Internet. Your setup is different, but I published these statistics to compare between them as the other environment aspects are almost fixed/stable.

benchmark apt-get update ๐Ÿ”—

$ time sudo apt-get update
________________________________________________________
Executed in  249.98 secs      fish           external
   usr time   17.11 millis    0.00 micros   17.11 millis
   sys time   36.06 millis  772.00 micros   35.29 millis

$ time sudo apt-get update
________________________________________________________
Executed in  244.07 secs      fish           external
   usr time   16.92 millis    0.12 millis   16.80 millis
   sys time   37.76 millis    1.02 millis   36.74 millis

$ time sudo apt-get update
________________________________________________________
Executed in  245.74 secs      fish           external
   usr time   13.66 millis    0.00 millis   13.66 millis
   sys time   40.05 millis    1.16 millis   38.89 millis

benchmark apt update ๐Ÿ”—

$ time sudo apt update
________________________________________________________
Executed in  245.08 secs      fish           external
   usr time   18.29 millis    0.00 micros   18.29 millis
   sys time   33.61 millis  689.00 micros   32.92 millis

$ time sudo apt update
________________________________________________________
Executed in  246.59 secs      fish           external
   usr time   15.82 millis  391.00 micros   15.43 millis
   sys time   39.28 millis  199.00 micros   39.08 millis

$ time sudo apt update
________________________________________________________
Executed in  236.41 secs      fish           external
   usr time   23.07 millis  689.00 micros   22.38 millis
   sys time   31.53 millis    0.00 micros   31.53 millis

benchmark apt-fast update ๐Ÿ”—

$ time sudo apt-fast update
________________________________________________________
Executed in  250.15 secs      fish           external
   usr time   18.54 millis    0.00 micros   18.54 millis
   sys time   31.18 millis  645.00 micros   30.53 millis

$ time sudo apt-fast update
________________________________________________________
Executed in  250.28 secs      fish           external
   usr time   14.86 millis    0.00 micros   14.86 millis
   sys time   39.57 millis  718.00 micros   38.85 millis

$ time sudo apt-fast update
________________________________________________________
Executed in  250.03 secs      fish           external
   usr time   25.23 millis  345.00 micros   24.88 millis
   sys time   32.17 millis  290.00 micros   31.88 millis

There is a warning displayed in the command output.

W: https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu/dists/noble/InRelease: Signature by key A2166B8DE8BDC3367D1901C11EE2FF37CA8DA16B uses weak algorithm (rsa1024)

So, I decided to manually re-install apt-fast .

I removed its PPA by this command.

sudo add-apt-repository --remove ppa:apt-fast/stable

Then I uninstalled the apt-fast executable script itself by this command.

sudo apt remove --purge apt-fast -y

After that, I installed apt-fast by this command.

/bin/bash -c "$(curl -sL https://git.io/vokNn)"

benchmark apt-fast update (after re-install) ๐Ÿ”—

$ time sudo apt-fast update
________________________________________________________
Executed in  249.89 secs      fish           external
   usr time   15.38 millis  342.00 micros   15.04 millis
   sys time   36.85 millis  185.00 micros   36.67 millis

$ time sudo apt-fast update
________________________________________________________
Executed in  249.69 secs      fish           external
   usr time   18.18 millis  167.00 micros   18.01 millis
   sys time   37.01 millis  992.00 micros   36.02 millis

$ time sudo apt-fast update
________________________________________________________
Executed in  249.67 secs      fish           external
   usr time    8.97 millis  398.00 micros    8.57 millis
   sys time   43.06 millis  217.00 micros   42.84 millis

Real world comparison ๐Ÿ”—

Let’s pull all benchmarks/statistics in comparison to deduce which is the fastest.

apt-get updateapt updateapt-fast update
#1249.98245.08249.89
#2244.07246.59249.69
#3245.74236.41249.67
avg246.5967242.6933249.75

After calculating the average of each three runs of the same command, we can compare the averages.

Seeing these three numbers means that apt is the fastest one with ~243 seconds.

But I do not accept these benchmarks, I think apt-fast can do better. I want to change some settings of apt-fast.

I set the underlying package manager to apt as it performed better in the benchmarks.

I edited /etc/apt-fast.conf like this.

# Default: apt-get
#
-#_APTMGR=apt-get
+_APTMGR=apt

Let’s check if this makes a difference.

$ time sudo apt-fast update
________________________________________________________
Executed in  249.85 secs      fish           external
   usr time   11.37 millis  336.00 micros   11.03 millis
   sys time   38.77 millis  156.00 micros   38.61 millis

Its performance is the same.

Let’s change the maximum number of connection to 2 instead of 5 , and see if this makes any difference.

In /etc/apt-fast.conf.

# Maximum number of connections
# You can use this value in _DOWNLOADER command. Escape with ${}: ${_MAXNUM}
#
# Default: 5
#
-#_MAXNUM=5
+_MAXNUM=2

Here is the benchmark after the change.

$ time sudo apt-fast update
________________________________________________________
Executed in  250.03 secs      fish           external
   usr time   17.46 millis    0.00 micros   17.46 millis
   sys time   34.69 millis  727.00 micros   33.96 millis

It seems these things doesn’t matter!

But what if I changed the mirrors into a faster servers.

Change Ubuntu server mirror ๐Ÿ”—

I checked the Ubuntu archive mirrors , and I chose one of the fastest servers and set sources to get from them.

After changing the mirror server, let’s check their effect on update command using apt-get, apt, and apt-fast.

$ time sudo apt-get update
________________________________________________________
Executed in  249.79 secs      fish           external
   usr time   15.94 millis  305.00 micros   15.63 millis
   sys time   33.83 millis  155.00 micros   33.67 millis

$ time sudo apt update
________________________________________________________
Executed in  250.74 secs      fish           external
   usr time   14.68 millis  309.00 micros   14.37 millis
   sys time   37.12 millis  175.00 micros   36.95 millis

$ time sudo apt-fast update # _MAXNUM=2
________________________________________________________
Executed in  250.03 secs      fish           external
   usr time   12.17 millis  382.00 micros   11.79 millis
   sys time   37.96 millis  232.00 micros   37.73 millis

$ time sudo apt-fast update # _MAXNUM=5
________________________________________________________
Executed in  254.85 secs      fish           external
   usr time   22.99 millis  315.00 micros   22.68 millis
   sys time   34.62 millis  108.00 micros   34.51 millis

The results are actually worse!

What about the main server? ๐Ÿ”—

Let’s change to it, and check.

$ time sudo apt-get update
________________________________________________________
Executed in  249.85 secs      fish           external
   usr time   18.70 millis  292.00 micros   18.41 millis
   sys time   34.97 millis   89.00 micros   34.88 millis

$ time sudo apt update
________________________________________________________
Executed in  249.80 secs      fish           external
   usr time   16.26 millis  277.00 micros   15.98 millis
   sys time   33.85 millis  113.00 micros   33.74 millis

$ time sudo apt-fast update # _MAXNUM=5
________________________________________________________
Executed in  249.82 secs      fish           external
   usr time   17.06 millis  400.00 micros   16.66 millis
   sys time   32.21 millis  168.00 micros   32.04 millis

After all the above changes and benchmarks, I came to the conclusion. It doesn’t matter. Yes! just stick to recommended APT package manager on Ubuntu.

I uninstalled apt-fast, and I will use apt packagemanger with no abstraction layer over it for speed or performance. APT is as performant as it can be. (according to the previous/above benchmarks)

I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .

Share:
waffarx cash back