For one, most people get all of their software from the Distributions Repository, only software that has gone through many tests and great scrutiny are loaded into the repository.
Those who get there software from somewhere on the Internet, will either check the source code, or verify the cryptographic hash i.e., SHA-224, SHA-256, SHA-384, SHA-512, &c.
The permissions. In order for something to install on Linux, the user has to give it permissions. Even small scripts which are downloaded from the net, require the user to open a terminal and give the script permission to be executed., i.e., chmod +x file.
~~~~~~
A little interesting fact, most people think that Linus Torvalds named Linux after himself which couldn't be further from the truth. Linux itself got its name from Ari Lemmke who ran the FTP server the original Linux Kernel was uploaded to. Linus Torvalds, the creator of the Linux kernel, wanted to name the kernel Freax, but Ari instead gave him a folder called “linux” to upload his kernel to. The Linux name came from “Linus’ Minix” which was the operating system Linus was trying to replace for himself.