Linux Operating System Basics (v)

Source: Internet
Author: User

Linux Network and RPM-installed Yum Source Configuration 1.Linux Network

1. Use the Ifconfig command to maintain the network (see Linux System Management P422)
1) function of the Fconfig command: Displays the details of all the network cards being started or sets the IP address of the network card in the system.
2) Use the Ifconfig command to set the IP address of the NIC:
For example, modify the command for the IP address of the ETH0 network card with the 172.18.48.56 and subnet mask 255.255.255.128:
Ifconfig eth0 172.18.48.56 netmask 255.255.255.128
2. Use the Ifup and Ifdown commands to start and stop the network card (see Linux System Management P424)
1) function of the Ifup command: Start the specified NIC on the system.
2) function of Ifdown command: Stop the network card specified on the system.
3) Use the IFUP command to enable an example of a specified NIC:
Example: The command to start the eth0 Nic: Ifup eth0
4) Use the Ifdown command to deactivate an example of a specified NIC:
Can only be used for configuration files
Example: Disable the eth0 NIC command: Ifdown eth0
3. Network configuration file (see Linux System Management P425)
1) The configuration file of the network card is stored in the/etc/sysconfig/network-scripts directory, and the corresponding profile file name of each NIC starts with ifcfg-, such as eth0 the network configuration file corresponding to this NIC is Ifcfg-eth0.
Add: The virtual machine added network card does not have the configuration file to manually add the configuration or graphics add network card
The definition of network configuration: the so-called network configuration (setting) is to modify the network configuration file card, you can use the text editor (vi) directly edit the network configuration file to reconfigure the network

2.RPM Packages

1. Use RPM to install and remove software (see Linux System Management P374)
1) RPM Definition: RPM is the abbreviation for Red Hat package Manger.
2) The file name of RPM is divided into 5 parts, where:
The 1th part is name, which indicates the names of this RPM package, and
2nd is version, which indicates the revision number of the RPM package;
3rd is release. Indicates the number of version releases (fix numbers) for this RPM package;
Part 4 is architectures, which indicates which platforms the RPM packages apply to;
the last part is RPM, which indicates the file extension of this RPM package.
3) RPM software installation and removal work frequently used options:
a) –i: Install software.
B) –U: Upgrade (Upgrade) The older version of the software.
C) –e: Remove/Remove (Erase) software.
D) –v: Displays detailed processing information.
e) –h: Displays the installation progress. Uninstall cannot be used with
2. View the information in the RPM package (see Linux System Management P379)
1) Common commands for querying installed package information:
a) Rpm–qa: Displays all packages installed on the current operating system, where q is the 1th letter of query, and a is the 1th letter of all.
Rpm–qa | grep dhcp
B) rpm–qf file name: Shows which package the file was installed in, and F is the 1th letter of file.
For example: The command that lists the package that installs the/bin/tar file is: Rpm–qf/bin/tar
C) RPM–QI package name: Displays the information for this package, I is the 1th letter of the information (message).
Example: a command that lists details of this package Tar-1.14-10.rhel4: Rpm–qi tar-1.14-10.rhel4
D) RPM–QL package name: Lists all the files contained in this package, Where L is the 1th letter of the list.
For example: List the commands that tar-1.14-10.rhel4 all the files contained in this package: Rpm–ql tar
RPM packet
3.RPM Property dependency problem for package
1) The definition of the property dependency problem for RPM packages: The property dependency problem of the so-called RPM package, that is, the installation of this package depends on the installation of other packages.

3.yum usage and local yum configuration

1. Yum function: Yum is the abbreviation of Yellow Dog Updater, modified, the purpose is to determine the dependency of rpm, user-friendly software installation, upgrade and so on.
2. CD mount and mirroring Mount
A) CD-ROM mount
MOUNT/DEV/SR0 mount point
Or
Mount/dev/cdrom mount point
b) Mount the image file
Mount-o loop-t iso9660 image file mount point
Wherein,-O loop: Used to attach a file as a hard disk partition on the system
Configuration of 3.yum
Yum configuration generally has two ways, one is to configure the yum.conf file in the/etc directory directly, and the other is to add the. repo file under the/ETC/YUM.REPOS.D directory.
4. Local Yum Configuration
[[email protected] ~]# mount/dev/cdrom/mnt #挂载光盘到/mnt Directory
[Email protected] ~]# cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
Rhel-source.repo
[email protected] yum.repos.d]# CP Rhel-source.repo Rhel.repo #拷贝一份配置文件
[Email protected] yum.repos.d]# vi rhel.repo #编辑配置文件如下 [rhel-local] #模块名称, you must modify the same name as the other. Repo file name=red Hat Enterprise Linux 6 local repo #名称随便起baseurl =file:///mnt #指定rpm仓库的位置
Enabled=1 #1开启该配置, 0 to close
Gpgcheck=1 #1为校对软件
[email protected] ~]# Yum install vsftpd httpd #安装vsftpd及httpd服务
5. Remote Yum Configuration method
6. Build the Yum source server with VSFTPD:
VSFTPD The default configuration file is to allow anonymous access, which can be started directly here:
[Email protected] ~]# Umount/dev/cdrom #卸载光盘
[Email protected] ~]# mount/dev/cdrom/var/ftp/pub/#挂载光盘到vsftpd的公众目录
[Email protected] ~]# service vsftpd Restart #重启vsftpd服务
Firewall and SELinux must be turned off
Service iptables Stop
Getenforce: View selinux status
Temporary shutdown: No restart: Setenforce 0
0 permissive allow 1 enforcing to execute

To configure the client:
[Email protected] ~]# cd/etc/yum.repos.d/
[email protected] yum.repos.d]# ls #rhel. Repo is generated according to the local Yum configuration
Rhel.repo Rhel-source.repo
[email protected] yum.repos.d]# cat Rhel.repo #修改为以下内容
[Rhel-ftp]
name=red Hat Enterprise Linux 6
Baseurl=ftp://192.168.8.42/pub #指定yum源地址
Enabled=1
Gpgcheck=1
Test:
[email protected] ~]# Yum install bind #安装DNS服务
7. Install the software using Yum
Yum–y Install software name
8. Using Yum to remove software
Yum–y Remove software Name
9. Installing Components with Yum
Yum–y Groupinstall Component Name
10. Using Yum to remove components
Yum–y Groupremove Component Name
11. Clear Yum Cache
Yum Clean All
12. Find Packages using Yum
Yum Search

Self-built Yum Warehouse

1. Copy the rpm file from the disc image to the folder in the self-built Yum repository

3. Use Createrepo to change the Yum source folder to ' warehouse '

3. Back up files that were originally in the/etc/yum.repo.d/directory

4. Customizing the Repo file

Linux Operating System Basics (v)

Related Article

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.