Linux Basics (4)

Source: Internet
Author: User

Job One: 1) Add a 15G SCSI hard disk before opening the Linux system 2) Turn on the system, right click on the desktop, open the terminal 3) for the newly added hard disk partition, a primary partition size of 5G, the remaining space to the extended partition, on the extended partition divided 1 logical partitions, the size of 5G 4) format primary partition as EXT3 system 5) Set logical partition to swap partition 6) enable the Swap partition for the previous step 7) View the status of the swap partition Job Two: free command to view memory organizing the role of buffer and cache Cache isBuffer , is a cache, faster than the speed of main memory, he generally has just used the CPU data or the loop used to save some of the data, so that the next time the CPU read, improve the speed of operation. Buffer isbuffers , used to store different speed devices, in the execution of a number of different processes, the need to write data to the hard disk, in order to improve the efficiency of the data will be stored in buffer, during which the CPU can do other things, The CPU can then read the data without interruption, continuous and high-speed reading, reducing the waiting time. Calculate real Memory Utilization such as true memory utilization is: (Buffer/cache + used)/total   Job Three: DD command to test hard drive speed. I created a new 1.txt file and wrote 10,000 lines in it for copying. Note: If the input file;of is the output File;bs is the block size (the size of the copied file); count is the number of copies. Job Four: Find a process named firewall and force it to killNote: The command to reopen the firewall is: Systemctl start firewall, or you can use stop to close job Five: RPM command 1) Mount the disc file to the/media directory 2) Enter the packages directory under the/media directory 3) View all RPM packages installed on the system 4) Check to see if the system is installing DHCP packages 5) Install the DHCP package 6) View information for DHCP packages 7) View all files included in the DHCP package 8) See which package generated the/bin/ls file 9) Uninstalling the DHCP package job Six: Yum command 1) Customizing the Yum repository: Createrepo first create the Createrepo directory under the root, because it is the installation of the HTTPD package, I need to know the installation of httpd need to rely on software packages, So I first use RPM installation to see which dependencies need to be downloaded from the network or elsewhere (to facilitate our copy from CD packages). The picture shows that we need four dependent packages and a package that needs to be installed, we copy these packages to/createrepo, and build the package relationship Repodeta and make it into Createrepo warehouse. 2) Customizing the repo file then after the Yum Warehouse is established we need to use Yum to install, we need to point the Yum command to this repository, which is to create the Yum configuration file (repo file), first we need to enter the/etc/ YUM.REPOS.D, and move the system's own repo file to another location, because the Yum source in these profiles is pointing to the CentOS website, it will execute the files in one step if not removed, possibly updating the system and software, causing some operations to malfunction. of course, if we don't move, we can change the enabled option of the config file to 0 . Now let's start by customizing Install the httpd repo file and use Vim Httpd.repo.

Note: BaseURL represents the Yum source, which is the Yum repository we created in the previous step, and the next line indicates that the Yun source is turned on. 3) Install the HTTPD package using the Yum command after completing the above steps, you can install the HTTPD software package. (where-y means yes)

4) Uninstalling the HTTPD package: yum–y Remove software name 5) Install the component ' KDE desktop ' using yum: Yum–y Groupinstall Component Name before installing, we need to move the config file in yum.repos.d to find the KDE desktop package on the Internet based on the reliable Yum source.

6) Master using Yum to remove components ' KDE Desktop ': Yum–y groupremove Component Name 7) Master purge Yum cache: Yum clean AllNote: Why to clear the cache, the cache will be installed before the installation package into the inside, if you do not clear the cache again in the case of the Yum installation, he is looking for you to install the software before the source,in this case, you may get an error or can't find the software you want to install, and if you clean it up again, he will reload the source and add it to the profile you set. 8) Use Yum to find packages: Yum Search package name after the Internet search, we will find that this is a package with httpd. Job Six: source code installation Python 1. First we need to download the Python3.6 version of the compressed package on the official website, and then drag the package directly from the physical machine to the virtual machine you want to store the directory (here we put under root), because this is the source based on C, we need to install GCC to compile these source code. for GCC, which belongs to a glibc library file, they are the development tools that can compile C, and these exist in the packages package, so like installing packages above, we need to configure a Yum repo file first. and then install. Note: Here we need to note that when making a repo file, you need to point the source to local. So you need to mount the/dev/sr0 to a directory (because the original mount path contains spaces, as the source link may error)
Note: We have installed all the development tools, including GCC (to compile C) 2. After the installation is complete, we can compile the Python installation package, as we download the compressed package, here we first unzip.

After decompression we CD to the extracted directory (CD Python-3.6.0)

here we need to execute the Configure file (he can configure the installation option), we set it to install to/usr/local/python3.6. 3. Finally we compile (make) and install (make install). Code is written as(Make && make install) During the installation, a zlib is not available, where we can install a zlib. Re-execute the previous command after the installation is completeafter the installation is complete, re-execute the previous command. 4. This completes the installation of the Python3.6. If you want to run it we need the CD to the place where he installed it, there will be a bin directory, which is loaded with executable files, into which we can use./python3.6. 5. Of course, if this is going to be a hassle every time, we can add it to the environment variable so that he can run in any directory as long as the input Python3.6. we can see that it has been added to the environment variable path, and the CD can be run in any directory, but in order to be able to save this feature permanently (that is, it can be used again at other terminals or after booting again), we need to join the/etc/profile,(executive Vim/etc/profile) , and save the exit.

This completes the entire installation of Python.

Linux Basics (4)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.