r/linuxquestions • • Sep 01 '22

Resolved How does Linux already know which app to install with just "sudo apt-get install" thingy

So I went through some Linux tutorial that made me install apps and I dont get how Linux can install, for example, VLC Media Player, with just `sudo apt-get install vlc

Like wtf? How did it determine that VLC Media Player is the one I want to install and not another app with "vlc" in the name? Also what if there are multiple versions available, how did it choose among them?

Edit: Thank you everyone for your reply, I got even more helpful information than what I asked for. I really appreciate it. Sorry if I can't thank you all one by one anymore, I've fallen down the rabbit hole and now browsing in r/unixporn. So much exciting things to do!

186 Upvotes

87 comments sorted by

View all comments

Show parent comments

2

u/unkilbeeg Sep 01 '22

To expand a little, all the software a distribution has is in a publicly available storage area known as a repository. As everyone else has told you, proprietary software is rarely in those repositories.

HOWEVER. Some vendors of proprietary software maintain their own repositories for just their software. Google is one of these. You can add their repository to your list of where to get software, and from that point on, you can just sudo apt-get install google-chrome-stable and not have to mess with complex scripts to download the deb and install it.

Honestly, I'm a little surprised (and dismayed) that a tutorial has you doing that.

https://www.google.com/linuxrepositories/

1

u/Complex_Solutions_20 Sep 01 '22

I've seen both ways. At work, we tend to shy away from allowing 3rd party repositories to "keep the system pure" and manually install 3rd party stuff with explicit justification and minimum additional required packages, licensing, and other details that get tracked. They worry it would be too easy to install something that would break rules (such as a repo including not-for-commercial-use software) or load in additional unwanted stuff that could conflict and we don't know about it.

At home, I just install the repos and make it easy for myself. So far no issues to speak of doing that.

I sort of understand both philosophies.

2

u/unkilbeeg Sep 01 '22

And another wrinkle on adding repositories (at least for Debian based systems) is the fact that adding the signing key (which is necessary to be sure the software is really coming from the repository) is accomplished by using apt-key -- which has been deprecated. It stores the key in the "wrong" place, and if you use it, apt will forever complain that the key is not where it's supposed to be. So far, I haven't found a newbie friendly way to add a key "correctly".

It can be done, but it's kind of convoluted, and I have to look it up each time.

1

u/Complex_Solutions_20 Sep 01 '22

I didn't know this, but that makes sense if it goes in the wrong place will cause much pain.