I searched around on Google for a while, I found the code listed below
I presume this is only a snippet of the full instructions, as step 1 here, makes zero sense as a first step.
What exactly did I do
I'll go into further detail below, but basically you downloaded a couple DEB files, installed them, and then attempted
(and presumably succeeded) in installing any dependencies.
sudo gdebi kingsoft-office_9.1.0.4244~a12p3_i386.deb
Gdebi installs "kingsoft-office_9.1.0.4244~a12p3_i386.deb" from the currently browsed directory, as well as any dependencies
(provided they are available in your repos).
cd && wget -O wps-office.deb http://kdl.cc.ksosoft.com/wps-community/download/a15/wps-office_9.1.0.4751~a15_i386.deb
Cd kicks you to your user's directory, Wget then downloads "wps-office_9.1.0.4751~a15_i386.deb" from the specified URL, and saves it as "wps-office.deb" in your currently browsed directory.
sudo dpkg -i wps-office.deb
Dpkg installs "wps-office.deb".
sudo apt-get -f install && rm wps-office.deb
Apt-get installs any missing dependencies for any packages
(not just WPS Office) if they are available in your repos. Rm deletes the file "wps-office.deb" from your currently browsed directory.
wget -O web-office-fonts.deb http://kdl.cc.ksosoft.com/wps-community/download/a15/wps-office-fonts_1.0_all.deb
Wget downloads "wps-office-fonts_1.0_all.deb" and saves it as "web-office-fonts.deb" in your currently browsed directory.
sudo dpkg -i web-office-fonts.deb
Dpkg installs "web-office-fonts.deb".
is it safe to install software following code I don’t understand?
I would not advise running commands you don't understand, unless doing so in a contained testing environment. Even if you trust the author of the commands, they could neglect to mention something important
(assuming you'll know, which you won't), or have a typo
(which you won't catch since you aren't familiar with the command). Sudo commands are particularily dangerous to run, because they usually mean you're giving the command permission to run as root
(which means it has 100% access to your entire system). In this case, the commands are safe, provided you trust the software developer
(while I've never used anything from KingSoft, I have heard of them before). Remember, you can often use "man program-name" or "program-name --help" to find out more information about a command. For example, you used "wget -O" in these commands. If you wanted to know what "wget -O" was doing, you could use "wget --help" and you'd see Wget is a download manager and "-O" specifies an output file.
why isn’t the program available from the Mint repository if it works?
The developers may not have submitted it to be in the repos, or it may not qualify to be in the repos. There is plenty of software not in the default repositories. Some developers setup their own
(which you can add to your system), others just provide a download
(as is the case here).
I apologize for asking questions which may seem obvious to many of you, but being new to Linux, it gets very confusing.
No need to apologize. These are good questions to ask, and if you're already venturing into this, you've picked up Linux much faster than I did when I started out.
Please note that the instructions you've used install a 32bit version, which is what you want if you're running a 32bit Linux Mint install. If you're running a 64bit version of Linux Mint, you can install the 64bit version of WPS Office, or the 32bit version. The version you've installed is also, not the most recent version. You installed "wps-office_9.1.0.4751~a15", the most recent is "wps-office_9.1.0.4975~a19p1".
EDIT: I hit the quote-box limit so I've changed some of these to code-boxes instead.