Welcome to the forum!
I’m afraid what you wish to do is a Windows-ism. GNU/Linux is a UNIX operating system, and UNIX doesn’t work that way.
The package always contains the paths to where the files from the package will be installed because UNIX is an integrated system. Once the package has been installed, its files will be distributed along the various directories of the filesystem hierarchy. So for instance, the shared libraries will always go under /usr/lib
, the executables under /usr/bin
, and so on.
The only exception to that rule are the games and stuff that you install through Lutris or Steam, because those are actually Windows games that have been made to run in GNU/Linux by way of a translation layer.
Now, the above all said, Snaps and Flatpaks are also different in that regard, because they are containerized applications ─ they are not integrated with the rest of the operating system ─ but even they normally have their designated directories contained in the package itself.
There is also certain third-party software that doesn’t come installed through the distribution’s package manager ─ although there are exceptions to that rule, e.g. Discord ─ and that comes with an installer of its own, usually in the form of a self-extracting archive. Those packages will then normally go under /opt
, although ─ as I mentioned ─ Discord is one of those weird ones; it installs partly under /usr
and partly under /opt
.