DAY-8 Linux Basics and Common commands (4)

Source: Internet
Author: User

First, make swap partition (command)

Swapon–s view the swap partition for the current activation status

Free–m viewing partitions in units of M

Swapoff Close partition Swapon open partition

Add swap partition--mkswap/dev/SDB makes the whole disk as a partition into swap

Then open--swapon/dev/sdb .

Second, network Configuration (command)

1, the command to modify the network card IP address: ifconfig

2, ifconfig plus network card name down/up--activation and shutdown

3. Route–n View Network configuration information

4, permanently modify the network card IP address

NIC configuration file Address: cd/etc/sysconfig/network-scripts/

Third, package management

RPM software Package (post-compilation)

RPM package is old version, but stable, conversion from source code to rpm,rpm command need to solve the dependency

1, Win installation software is the binary installation method, the programmer wrote the program is a file, is a language that people can understand, want to computer recognition, you must compile into a computer can understand the binary

2, in Linux also have this installation, can be downloaded on the Internet or in the image of the package, the first image to be set in the CD, DF view, you can mount the path monnt/dev/sr0/opt/, and then browse opt to see the content

3, into the directory, view the packages directory, and then browse to the end of RPM, binary format package (originated from Red Hat)

4, Rpm–ivh back with the RPM format package, if there is a dependency package, first install the dependency package, then install the target software, the disadvantages of their own dependency, an installation, when the uninstall encountered dependency software block, use command rpm–e with the package name--nodeps, regardless of dependencies, Uninstall directly. Overwrite the installation command RPM–IVF package name –force.

5. View the installation package Rpm–q Zsh,zsh is the installation package name, RPM–QA View all packages, RPM–QA | grep zsh filter View, rpm–e with package name, uninstall directly, RPM–QL View package installation path, Rpm–qi View package details, RPM–QF see which package generated the command

Yum packages to solve the dependencies of the software package

Yum-y Erase http-* Delete package (does not delete dependent packages) yum-y Install HTTPD installation package

1, the source code in cd/etc/yum.repos.d/, inside each URL corresponding is the package, the network source

2, how to configure their own source? First move the files under the folder to the new folder under the root, then delete

The source is the storage software, can source the network, also can source local, there is software package DF view hard disk information (mount path), and then into the directory (that is, the source), folder to the dependency relationship written, Yum can solve, repodata files have dependencies, Specifies that the source must specify the directory that is actually mounted, yum source must be a package + dependency

Enter cd/etc/yum.repos.d/, create a directory, vim enter

Start writing configuration: The first row of the title is not limited, but must write, the second row name, the third row specifies where the Yum source, baseurl= if the URL must start with http://, if it is a local source, is the file file://beginning, followed directly with the path/opt, Row four enabled=1, fifth row gpgcheck=0, save exit

Yum clean all clear yum cache yum Makecache–y make cache

Yum source will automatically update the software, be sure to turn off Automatic Updates (vim/etc/yum/yum-cron-hourly.conf), the package to be unified, to save the downloaded package, address vim/etc/ Yum.conf, the first Cachedir cache directory (you can specify), Keepcache=1 is to save the package, 0 is not to save, and then build the specified directory, try to load the package, then go to see if there is a package in the directory, then have their own package library, and then build a dependency relationship (Command creater followed by directory)

About the Yum command:

Yum list--View all of its RTM packages

Yum grouplist--View Package group Yum Groupinstall "Development tools"-Y Install package Group

To download the latest software package must be the source format, has not been made into RPM package, then compile the installation

Take Python as an example: Install Python interpreter, enter the official website SourceCode is the source package, download

1. First install this package yum install Lrzsz

2, directly drag the past, this is the tar package, tar xvf unpacking, and then see the directory

3, enter the directory, inside a pile of files, compiled files (changed to binary)

4. Before compiling, specify some parameters (where the package is installed, what function to start, etc.), use cd/configure this file,./directly execute this file, followed by--prefix=/usr/local/python3.6, specify to install to this directory

5, before starting to compile, you must install the development tools, and then do make, then do install, you may also need to solve the dependency problem, according to the dependency information, if not know, directly-* install all

6, after the completion of execution, in the specified directory

DAY-8 Linux Basics and Common commands (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.