Here’s an idea:
3 Applications depend upon file libntll.
2 of those applications use libntll 1.7, while 1 of those applications uses libntll 1.6.
libntll is distributed with each application’s package, which means there are two copies of libntll 1.7.
So, instead of having 2 copies of the same dependency, what if every time a package was updated, snapd used checksums like SHA to find copies of the same file, and then replaced those files with symlinks to one single copy stored elsewhere. When an application is updated, it checks if any changes are needed. This way, only one copy of the same file would be used, because the apps would share the same copy.
With this lifecycle:
- When apps are installed, checksums made for every dependency
- When a new app is added, search a checksum database for identical dependency. If found, replace them with symlinks to one copy only.
- When the app is updated, check if dependency was modified. If so, replace the symlink with the real file, then proceed.