Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 1556  / 2 Years ago, thu, october 27, 2022, 6:35:48

I downloaded google-chrome for Linux, it got downloaded as a .deb file in downloads folder. I changed the current directory to the downloads folder and ran "google-chrome" in terminal. It started google chrome, but the issue is that .deb file is not a script(as I understand). Then how did the terminal understand that the 'google-chrome' command meant to start it? Commands like emacs...etc are already built-in. What about this command which is new to bash? How did it recognise it?


More From » deb

 Answers
5

First a few basics:



When you run a command on your terminal, you enter the name of a file, (which should be executable): if you enter a simple name e.g. emacs, the system searches a number of directories for a file with such name. This list of directory is your PATH (i.e. it is stored in a variable named PATH). you can see its contents by typing echo $PATH. (As a side note, these commands are not built-in like you said in your question... but some are, for instance ls, which don't have any executable file, but is directly executed by the shell)



Alternatively, you can enter a more complex filename, which include the directory : /usr/bin/emacs, or event relative pathnames ! For instance, if you want to run the program in the file myprog, residing in your user directory, enter ./myprog (. meaning current directory)



Now back to your question:



When installing software, the system has to take care of putting everthing in the right place, so you can find it later on... It is what the package manager does : it takes an archive (.deb file), open it, and basically, put the files in the right places.



In conclusion, you have to open your .deb file with the package manager.



cd ~/Downloads
dpkg -i google-chrome.deb


or, event better, install it through the software center.


[#31709] Thursday, October 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ovierman

Total Points: 445
Total Questions: 108
Total Answers: 111

Location: Libya
Member since Fri, Oct 30, 2020
4 Years ago
;