0

Let me detail what I try to ask.

When I use

sudo apk-get install blablabla

I get the output

After this operation, 39.6 MB of additional disk space will be used.

but when I execute

sudo apk-get purge blablabla

the output states I'll have 23.4 MB of additional disk space. What creates the difference?

Still new to Linux

0

2 Answers 2

3

The packages have something known as dependencies. For example , package cowsay depends on perl ( and you can verify that with apt-cache show pkgname). When you install a package, apt-get installs additional dependencies as well, but when removing a package - apt-get leaves dependencies alone, and you have to use autoremove option

On the other hand, it also doesn't account for the cache packages, i.e. the actual .deb package which apt downloads, then extracts stuff from it and compiles.

Check this:

$ apt-cache show cowsay | grep -i size
Installed-Size: 88
Size: 18532

Alldeb packages have this Installed-Size information field which by definition is

estimated installed size in bytes, divided by 1024 and rounded up

( Notice, it's estimated, it's may vary with the actual amount of installed files, and depend on how meticulous the package maintainer is about the details ) So the estimated installation will be 88*1024 = 90112 or 90.1 kB in size. And it coincides with what purge says:

After this operation, 90.1 kB disk space will be freed.

After I have purged the package, the archive however is still there:

$ ls /var/cache/apt/archives/cowsay_3.03+dfsg1-6_all.deb               
/var/cache/apt/archives/cowsay_3.03+dfsg1-6_all.deb

You can use apt-get flags clean and autoclean as well as remove those manually

0

Part of it is because there are configs (now I see you are doing purge), but there's also the cache space used up by the DEB archive when it's downloaded.

2
  • How to completely delete them all?
    – SarpSTA
    Nov 7, 2015 at 23:09
  • sudo apt-get clean will (supposedly) clean your cache.
    – FireFaced
    Nov 7, 2015 at 23:10

Not the answer you're looking for? Browse other questions tagged .