13, 14 Unit summary

Source: Internet
Author: User

#######################################################
############## #unit 13###################################
########################################################

############ #如何安装软件 #################################
# # #1. Software name Recognition # # #
[abrt-addon-ccpp]-[2.1.11-19]. [E17]. [X86_64].rpm # #rpm结尾的适用于redhat操作系统
||               ||               || ||
Software name software version software using System 64-bit

# # #2. How to install software # # #
1.rpm
Rpm-i name.rpm # #安装
-V name.rpm # #显示安装进度
-H name.rpm # #指定加密方式
-E name # #卸载
-QL Name # #查询软件生成文件
-QLP name.rpm # #查询软件安装后会生成什么文件
-QA # #查询系统中安装的所有软件名称
-QA |grep Name # #查询软件是否安装
-Q Name # #查询软件是否安装
-QP name.rpm # #查询软件安装包安装后的名字
-QF FileName # #查看filename属于哪个安装包
-IVH name.rpm--force # #强制安装
-qi Name # #查看软件信息
-KV name.rpm # #检测软件包是否被篡改


2.yum
Top software management tools, the most important function is to solve the software dependencies
Yum can be put into use only if there is a Yum source, and the configuration source points to the file

Yum List all # # #列出所有安装包
Yum List installed # # #列出已经安装的
Yum List available # # #列出没有安装的
Yum Remove Software # # #卸载软件
Yum install software # # #安装软件
Yum Search Keyword # # #搜索与关键字相关的软件
Yum whatprovides FileName # # #搜索包含此文件的包
Yum Reinstall Software # # #从新安装软件
Yum Localinstall third-party software # # #安装第三方软件并解决依赖关系
Yum Info softwarename # # #查询软件信息
Yum Clean All # # #清空yum缓存
Yum Update # # #更新软件
Yum History # # #查看系统软件改变历史
Yum Groups List # # # #列出软件组
Yum groups install Softwaregroup # # #安装组
Yum groups remove Softwaregroup # # #卸载组
Yum groups Info Softwaregroup # # #查看组信息




############## #官方软件仓库的建立 ###############

Server Source Side
1. Need a matching local installation image, Rhel-server-7.0-x86_64-dvd.iso, this file is downloaded from the official website
2.mount rhel-server-7.0-x86_64-dvd.iso/mnt
3.mv/etc/yum.repos.d/*/mnt
4.vim/etc/yum.repos.d/yum.repo
[Redhatsoftware] # # #仓库名称
Name=localsoftware # # #仓库描述
BASEURL=FILE:///MNT # # #仓库地址
Gpgcheck=0 # # #是否检测软件的gpgkey

5. Installing resource sharing files
Yum Install Httpd-y
Systemctl Stop Firewalld
Systemctl Start httpd
Systemctl Enable httpd

6. Create a shared directory and mount the image file to a shared directory
Mkdir-p/var/www/html/yumsource
Umount/mnt
mount/mnt/rhel-server-7.0-x86_64-dvd.iso/var/www/html/rhel7.1

7. Testing
Enter in the browser:/HTTP//native ip/rhel7.1
You can see the mirrored content
##<<<yum Source Address:/HTTP host ip/rhel7.1>##

8. Modify the native Yum source to point to
[Server]
name=rhel7.1
baseurl=file:///var/www/html/rhel7.1
Gpgcheck=0

9. Boot automatically hangs ISO
Vim/etc/rc.d/rc.local
Mount rhel-server-7.1-x86_64-dvd.iso/var/www/html/rhel7.1
: Wq

chmod +x/etc/rc.d/rc.local

Allows the system to read the contents of the Rhel-server-7.0-x86_64-dvd.iso
Vim/etc/fstab
/xxx/rhel-server-7.0-x86_64-dvd.iso/xxx iso9660 ro,relatime 0 0
Image file hangs on point type mount parameter backup detection

Mount-a

10. Building of third-party software repositories
Put all the RPM packages in a directory, this directory can only exist RPM files
Createrepo-v/rpm Storage Directory
Vim/etc/yum.repos.d/xxx/repo
[Software]
Name=software
BASEURL=FILE:///RPM Storage Directory
Gpgcheck=0

# # # #3. Client specified End # # # #
/ETC/YUM.REPOS.D # #仓库指向文件存储目录
Vim/etc/yum.repos.d/test.repo # # #仓库指向文件
[Redhatsoftware] # # #仓库名称
Name=localsoftware # # #仓库描述
baseurl=file://|ftp://|http://# # #仓库地址
Gpgcheck=1|0 # # #是否检测软件的gpgkey
Enabled=1 # # #此仓库在系统中生效
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release # #本机gpgkey文件


Yum Clean All # # #刷新仓库配置



# # # #4. Network Yum Source Configuration # # # #
Yum Install httpd
Systemctl Stop Firewalld
Systemctl Start httpd
Systemctl Enable httpd
Vim/etc/fstab
/xxx/rhel-server-7.0-x86_64-dvd.iso/var/www/html/source iso9660 ro,relatime 0 0

Mount-a

Yum Source:/http Current host/source





####################################################################
############################ #第十四单元 ###############################
####################################################################
1. Identification of equipment
/DEV/SDA # # #系统中的第一块串口硬盘
/dev/hda # # #系统中第一快并口硬盘
/DEV/HDB # # #系统中第二快并口硬盘
/dev/cdrom # # #系统光驱
/DEV/MAPPER/XXX # # #虚拟设备

Fdisk-l # #查看真实存在的设备
Cat/proc/partitions # #系统能够识别的设备
Blkid # #系统能够挂在使用的设备id
DF # #查看设备被系统使用的情况

2. Use of the device
(1) Mounting of the device
Mount device Mount point # # #挂载
MOUNT/DEV/SDA1/MNT # # #把系统中的第一快硬盘的第一个分区挂载到/mnt

(2) Unloading equipment
Umount Equipment | mount point # # #卸载设备
Blkid # # #显示所有可用设备的id信息
Df-h (2 of the N-square)-H (10 of N This party) # # # #查看挂载信息
Du-h (display unit)-s (only statistics directory itself) File|dir # # # #统计文件大小

(3). When the following problem occurs when the device is uninstalled
[Email protected] ~]# umount/mnt/
Umount:/mnt:target is busy.
(In some cases useful info about processes
The device is found by lsof (8) or fuser (1))

Use
FUSER-KVM Device | mount point-K kill,-V show details,-m scan device
Lsof Equipment | mount point
To find the process that consumes the device

2. Soft and Hard links
Ls-i # #查看文件节点号
Ln-s/file/file1 # #软链接
Ln/file/file1 # #硬链接

3. How to find files in the system
1.locate filename # #在文件数据中搜索filename信息, updatedb update file database
2. Find
Find command
Find path Condition Condition value
Find/mnt-name file
Find/mnt-name "file*"
Find/etc-name "*.conf"
-user # #用户
-group # #组
Condition 1-a Condition 2 # #并且
Condition 1-o Condition 2 # #或者
-type # #类型
-mmin +|-Number # #时间

DD If=/dev/zero of=/mnt/file1 bs=1024 count=10 10240bit

Find/mnt-size 10k # #筛选出大小等于10k的文件
find/mnt-size-10k # #筛选出大小小于10k的文件
Find/mnt-size +10k # #筛选出大小大于10k的文件

13, 14 Unit summary

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.