First, we should know the basic situation of computers. A computer is merely a combination of metals, semiconductors, and plastic products. If powered on, it can be started, but you can't do anything because it's just hardware. If you're not selling scrap iron, it's both heavy and glaring (especially if your computer has white casing). However, why are computers so appealing to us? Because of operating systems and application software.
An operating system is a special kind of software that enables the coordination between hardware and other software while handling actions such as typing on the keyboard or moving the mouse. Common operating systems include Windows with its many versions; MAC OS, which is used on Apple computers; UNIX, widely used in large machines for its stability; and Linux, our main focus today, a powerful, stable, high-performance open-source operating system.
Application software provides practical assistance. We use network software like IE for browsing, chat software like QQ for chatting, and download software like FlashGet for downloading resources. Thanks to various kinds of software, our computers become colorful and versatile.
However, please note that all these software mentioned only work under the Windows operating system. But Windows OS is expensive, especially for university students who are upholding Deng Xiaoping's great banner of building socialism with Chinese characteristics, closely uniting around the Central Committee of the Communist Party of China with Comrade Jiang Zemin at its core, liberating thoughts, adhering to facts, guided by Comrade Jiang Zemin's important thought of the "Three Represents," and constructing a new China. The price tag of over a thousand yuan makes us hesitate. Thus, piracy arises. According to the newly issued copyright law, selling pirated computer software is illegal, and purchasing and using pirated software is also an illegal act. How can we ignore national laws and take risks by buying pirated software?
But, life without Windows can still be wonderful. If we consider a computer as land, then Windows is the dark cloud above it. Only by dispersing this cloud can we see the beautiful sun. And our tool to disperse this cloud is Linux.
So, what exactly is Linux?
A long time ago, back in the 70s when Windows hadn't appeared yet, UNIX was the most widely used operating system. However, UNIX was also very expensive. Then there was a genius (I can't remember his exact name spelling, so I'll call him a genius; after all, misspelling someone's name is worse than calling them a genius), who wanted to create an open system. This system was vast, extremely vast, encompassing operating systems (there could be more than one, though now there isn't, we're just discussing Linux), software, various documents, media resources, and many other things. Most of these things use a protocol, commonly known as GPL or LGPL (simply put: all source codes are public, anyone can get them for free, modify or delete them, even sell them for profit, as long as you ensure that the modified software and sold software also use the GPL protocol). The genius gave this vast open system a striking name (is it striking?): GNU - GUN Is Not Unix.
Linux is the best-developed operating system within the GNU system. However, Linux is just a kernel, a noble and pure operating system kernel. This pure and noble operating system kernel was originally developed by another genius named Linus. At that time, this Finn wasn't much older than us, maybe even younger, but he was truly amazing. Combining the Linux kernel with many excellent applications from the GNU system forms what we now refer to as Linux.
So, what are Redhat Linux and Mandrake Linux?
In the recent past, during the 90s, Linux had begun to shine brightly. Since Linux belongs to the GNU system and adopts the GPL protocol, ensuring code openness, numerous companies flocked to make necessary modifications and enhancements based on the Linux kernel source code, develop accompanying software, select some excellent software, combine them, and release their own company's version of Linux. The American Redhat company released Redhat Linux, the French Mandrake company released Mandrake Linux, the German SUSE company released SUSE Linux, and many Chinese companies also crazily released their so-called Chinese Linux. However, domestic Linux has yet to reach mainstream standards. There are countless Linux companies and Linux distributions, and here we must mention Debian GNU/Linux.
Debian GNU/Linux is a very special Linux distribution. Unlike other Linux distributions developed and released by commercial companies, Debian GNU/Linux was initiated by another genius whose name starts with Ian. His wife's name starts with the first three letters Deb. Under the power of love, he initiated the Debian GNU/Linux organization, dedicated to developing a non-commercial Linux distribution. Love is indeed great, and he succeeded. Now, over 800 engineers worldwide contribute their spare time to Debian GNU/Linux, and this number continues to grow. Debian GNU/Linux is one of the better Linux distributions, and I will introduce it in detail later. From now on, I'll use Debian to represent Debian GNU/Linux.
Stories about kernel versions and distribution versions
Since Linux is just a kernel, and Linux distributions are a collection of the Linux kernel and various application software, Linux has two types of version numbers. One is the kernel version, and the other is the distribution version. The format of the Linux kernel version is x.y.zz-www, where different numbers represent different development versions, including stable and testing versions. Distribution version numbers are determined by each distribution company or organization. For example, Redhat Linux has versions 6.0, 6.2, 7.0, 7.2, 7.3, etc. Typically, even-numbered kernel version sequences indicate stable versions, while odd-numbered ones indicate unstable testing versions. Actually, Windows is similar; it's just that we don't hear about it often. For instance, the internal version number of Windows 2000 is 2195, while the release version is 2000. I wonder if any Linux distribution will use 2003 as its version number, haha.
Some conventions and websites
From now on, we'll use Linux to refer to Linux distributions, Kernel to refer to the Linux kernel, Debian to refer to Debian GNU/Linux, and Redhat to refer to Redhat Linux.
Here are some common Linux official websites:
http://www.kernel.org
http://linux.com
http://www.linux.org
http://www.linuxhelp.org
And here are some excellent domestic Linux forums:
http://www.linuxforum.net
http://www.linuxfans.org
http://www.linuxaid.com.cn
This search engine Google is highly recommended by us as the best search engine. I haven't used any other since I started using it.
http://www.google.com
Here are a few good free software bases, although there is a risk of being blocked by China Telecom, which is frustrating.
http://freshmeat.net
http://sourceforge.net
http://www.cosoft.org.cn
In the next chapter, we will discuss some basic knowledge of Linux, which is also some basic computer knowledge.
Chapter One: Basic Knowledge of Linux
Hard Disk
The hard disk is a medium that can store a large amount of information resources. The hard disk we usually see is a square, relatively heavy iron box, but actually, the hard disk is round. After adding some control circuits, it is designed into a square casing for portability. But the hard disk is really round, I'm not lying, otherwise, how would it be called a "disk"? Second, you need to know that hard disks can be partitioned. You can divide a hard disk into many partitions, so partitioning is both a noun and a verb. What does it mean as a noun? Nowadays, hard drives are getting larger, storing more and more resources. To manage and use hard drive resources more reasonably and improve query speed and access quality more effectively, we can divide the hard drive into many partitions to store different information. When you need to read a specific file, the system will automatically use the nearest head to read it, speeding up the reading process. Partitioning is a means of managing resources reasonably based on hardware.
You've understood partitioning, but we can't just have partitions; we need a way to control them. In the Windows operating system, the concept of drive letters is used, where single letters represent different partitions on the hard drive, such as C drive, D drive, etc. In Windows 2000 and earlier, C corresponds to the first partition, D to the second, and so on. In Windows 2000, this correspondence can be adjusted manually.
In Linux, we don't have the concept of drive letters; instead, we use directories for management.
Let me briefly explain directories to ensure the completeness of the article, though everyone probably already knows. If we throw tens of thousands of fruits into one basket, wouldn't it be hard to find them? But if we put apples in a basket labeled "apples" and pears in a basket labeled "pears"... wouldn't that greatly simplify the process of finding specific fruits? If these fruits are our files, then the baskets we use are called directories. A new problem arises: even if we put peaches in a basket labeled "peaches," it's still hard to find peaches from Chengdu, Sichuan among thousands of peaches. Clever you must think of putting many baskets labeled "Sichuan," "Hebei," "Guangzhou," etc., inside the peach basket and placing peaches from different origins into them. Yes! That's right! We can create new directories under a file directory and manage files in great detail. Here you understand what directories are and that directories can be nested, which is sufficient. Directory technology is a method of resource management based on software.
Returning to Linux's management of hard drives: In Linux, we don't have the concept of drive letters; we use directories for management. By associating each partition with a certain directory, operations on that directory are equivalent to operations on that partition, thus unifying hardware management methods with software directory management methods. This process of associating partitions with directories is called mounting. Such associations can be interrupted and changed by users at any time.
Swap Partition
You're already familiar with partitioning, but let's mention swap partitions here. Without enough memory, we might not be able to run some large software. The solution is to allocate a region on the hard drive as temporary memory, making it seem like the memory has increased. In the Windows operating system, this area is called virtual memory, while in Linux, it's called a swap partition. Although hardware prices have decreased, limiting our memory usage is less likely now, but the concept of swap partitions remains and continues to exist due to kernel-related issues, which we won't discuss much. What we want to say is that when installing Linux, if your memory is only 64MB or 128MB, it's best to set the swap partition size to three times that. If your partition is large enough, with 256MB or 512MB, setting it to the same size is sufficient. However, please note that the size should ideally be a power of 2.
Partition Format
Today, we've discussed many issues related to hard drives, and now we need to supplement one more thing: partition format. A hard drive is simply a medium that records information electromagnetically, and we can manage it through different formats. Different operating systems choose different formats, and the same operating system may support multiple formats. Microsoft's operating systems chose the FAT16 format for DOS partitions, then Windows 95 and 98 supported FAT32, Windows NT used NTFS4, Windows 2000 and XP supported NTFS5, and also FAT32, but they don't support the common Linux partition formats. Linux is an open operating system that initially used ext2, then ext3, but it supports many partition formats, including XFS used on large UNIX machines, as well as Microsoft's FAT and NTFS formats.
When partitioning the hard drive, you need to specify the partition format.
Understanding Linux's Directory Structure
Since directories are tools for convenient file management, what kind of files are stored in different directories under Linux?
Directory Name Meaning
/bin Contains commonly used Linux commands; in some versions, it includes directories similar to those in the root directory.
/boot Stores programs needed during system startup; when LILO boots Linux, it uses information from here.
/dev Includes all external devices used in the Linux system; these are actually ports to access external devices, allowing you to access these devices as if accessing a file or directory. For example, typing "cd /dev/cdrom" lets you see files on the CD-ROM; typing "cd /dev/mouse" shows relevant mouse files.
/cdrom This directory is empty upon initial system installation. You can mount the CD-ROM filesystem here, for example, "mount /dev/cdrom /cdrom".
/etc Stores various configuration files and subdirectories needed for system management, such as network configurations, file systems, X system configurations, device configurations, user settings, etc.
/sbin Stores system administrator's system management programs.
/home If a user named "xx" is created, there will be a corresponding "/home/xx" path in the /home directory to store the user's home directory.
/lib Stores dynamic linked shared libraries; almost all applications use shared libraries from this directory.
/lost+found This directory is mostly empty, but after sudden power outages or improper shutdowns, some files may temporarily be stored here.
/mnt This directory is generally empty, but you can temporarily mount other filesystems here.
/proc You can obtain system information from this directory; this information is produced by the system itself in memory.
/root If you log in as a superuser, this is the superuser's home directory.
/tmp Used to store temporary files generated by different programs during execution.
/usr Many user applications and files are stored in this directory.
Hardware Supported by Linux
Generally speaking, Linux's hardware support can be summarized in three sentences: newer hardware is harder to support, products from smaller manufacturers are harder to support, and increasingly more hardware is being supported! Therefore, it's recommended to use mature products from famous manufacturers.
In the next chapter, we'll introduce the installation of Linux. We've chosen Redhat Linux 7.3 as the Linux distribution for installation. Before installing, please be sure to familiarize yourself with the knowledge of hard disk partitioning we introduced.
Chapter Two: Installing Linux
Below, we introduce the installation of Linux. Various Linux distributions have different installation processes, but they are largely similar. Generally, except for domestic Linux distributions, other familiar Linux distributions support online installation via the network and hard disk installation. However, broadband usage is not widespread domestically, and hard disk installation can be somewhat troublesome, so we will introduce CD installation.
Redhat Linux is a relatively common Linux distribution in the domestic market, to the point that Redhat once became synonymous with Linux in the minds of many people. So, I've chosen Redhat as the textbook for the first installation of Linux. Actually, Mandrake Linux's installation interface is much prettier than Redhat's, but it seems quite difficult to obtain. In subsequent chapters, I will provide detailed instructions for installing Debian Linux, but that's a topic for another day.
Now, let's assume your hard drive is 20GB, and the Windows 98 system has already used up all 20GB, specifically as follows:
C: First 5GB D: Next 5GB
E: Next 5GB F: Last 5GB
We plan to install Redhat on the original F: drive, so please back up the data on your F: drive now.
Then, confirm that your system can boot from the CD. If not, press the Del key when the computer starts to enter the motherboard BIOS settings, modify the relevant options to allow your computer to boot from the CD. Then insert the first installation CD of Redhat into the optical drive and turn on the computer. At this point, you should see some boot prompts. With basic college English skills, reading these should not be a problem. Now, you can directly press Enter to start the graphical interface installation program, or type text and press Enter to start the character interface installation. Generally, the graphical interface consumes more memory, so the installation program runs slower compared to the character interface, but the graphical interface is more user-friendly. Considering this is our first installation of Linux, we will directly press Enter to enter the graphical interface installation program.
The first step of the installation is to confirm its copyright information. Of course, we agree! Both Linux and Windows have this step, but the copyright agreements you agree to are very different. Specifically, we will discuss this later, but remember: Linux gives you a world of freedom, which may currently have some deserts and wastelands; Windows gives you a beautifully crafted cage.
Now, please correctly select your keyboard type, generally PC104 will suffice. It seems that the Win key is not supported in Redhat Linux. Selecting the mouse is slightly more complicated. If your mouse has only two buttons and no scroll wheel, you must select the "Emulate Three-Button Mouse" option because the third button on the mouse is very useful in Linux.
Redhat will ask whether you want to install Workstation, Server, or Custom type systems, or choose Update to upgrade the existing Redhat. We will choose Custom!
Now configure the hard disk parameters, i.e., partitioning. We will not choose automatic partitioning as it is unsafe, very unsafe, especially unsafe. Choose manual partitioning, and I will guide you. Before proceeding, please ensure you are familiar with the basic knowledge of hard disk partitioning introduced in the previous chapter. If you forget, go back and review it. Note: Hard disk partitioning will erase the information previously saved on the corresponding partition of your hard drive!
I believe you have backed up all the data on the F: drive. Now, let's check what hardware devices correspond to each Windows drive letter.
Generally, C corresponds to /dev/hda1
D corresponds to /dev/hda5
E corresponds to /dev/hda6
F corresponds to /dev/hda7
Now select the /dev/hda7 corresponding to the F drive and delete it. Then create a new partition on the free hard disk space (which should be 5GB since we deleted a 5GB F drive) and set the partition type to SWAP, i.e., the swap partition. Its size should be selected according to the method described in the previous chapter, either three times the actual memory size or an appropriate number. However, please note that the size should ideally be a power of 2.
After completing the setup of this swap partition, add another partition and set its type to ext3. There will be an option for "mount point," which we call the mount point, set it to "/". Set its size to the remaining space. This way, the entire hard disk space is utilized.
Check if everything is done correctly? If you find any issues, now is the time to correct them because none of our changes have been saved to the hard drive yet. If everything is correct, proceed to the next step, and now the hard disk content will change according to our settings.
Are you excited? Ha ha, it might fail. I spent seven hours on my first Redhat installation just to understand what a mount point is. The entire hard drive was repartitioned repeatedly, and after installation, there were no files left. Ha ha, if you made a mistake in one of the steps, you might end up in the same sorry state. However, unless you feel the pain deeply, how would you remember it vividly? Engaging with Linux requires bold experimentation, just as Comrade Deng Xiaoping said, practice is the sole criterion for testing truth!
After reading this section, your hard drive should be formatted, and you should be at the stage of choosing what software to install. If you choose to install everything (there's an option at the bottom), you'll end up with a huge and extremely slow system, about 2GB. Full installation installs all server programs and irrelevant things. Unless you know what you're doing, never do this. Check if you have a printer, then select print support. The default options are usually sufficient, but I still recommend installing Software Development and Kernel Development options, which will facilitate future software installations. There are many window managers, KDE, GNOME, and some more lightweight ones like WindowMaker (my favorite). KDE's appearance resembles Windows, suitable for beginners, but GNOME is more attractive and faster. I rarely use KDE and have little experience with its localization, so I'll teach you GNOME. Later, I'll also teach you WindowMaker.
Continuing, it seems we've reached the software installation process, which typically takes 20 to 30 minutes to install all the software.
Don't rest during this time; keep reading the following content!! Haha
It appears Redhat will ask whether to use Grub or Lilo for booting. Maybe you're confused now, so I'll tell you: choose Grub because... although I'm more familiar with Lilo, I'll explain it to