-2

ls -la commands below brings file information gcc-8 that looks strange for me. I suppose it is not link. I know there are different GCC packages with different GCC versions and it looks like I have package with GCC version 8.

How to know gcc-8 is package and not link? Where this package is located? Why other binaries does not show its packages?

ls -la /usr/bin/gcc

brings

lrwxrwxrwx 1 root root 5 Apr 22  2021 /usr/bin/gcc -> gcc-8
vico
  • 4,447
  • 20
  • 55
  • 87
  • 2
    Why do you suppose it's not a link? Do you know [what the first column of `ls -l` is for](https://askubuntu.com/questions/517229/what-does-ls-la-do)? – muru Nov 04 '21 at 09:40

1 Answers1

0

How to know gcc-8 is package and not link?

gcc-8 can refer both to a package and a file or link. And most likely if you have package gcc-8, it will provide a file named gcc-8 (perhaps more than one). For instance, check with

$ dpkg -l | grep gcc-8

That will tell you whether package gcc-8 is installed in your system (ar use simply gcc instead of gcc-8 for other versions). Assuming you see package gcc-8 is present in your system, you can list all files provided by that package with

$ dpkg -L gcc-8

In the case you describe, /usr/bin/gcc is clearly a link to /usr/bin/gcc-8. If you want to know whether /usr/bin/gcc-8 is a file or link, simply use

$ ls -la /usr/bin/gcc-8

same as you did.

Where this package is located?

Packages have no location. They are installed, providing many files across the filesystem.

Why other binaries does not show its packages?

If you provide an example, the community might help clarifying this for you.