Linux system Administrator Technology (Admin)-------the third day

Source: Internet
Author: User
Tags yum repolist

Modify host name #vim?/ROOT/.BASHRC



Package Management


1. Make the contents of the disc file appear in the system

[Email protected] ~]# mkdir?/rhel7

[email protected] ~]# mount?/dev/cdrom? /rhel7

Mount:/dev/sr0 write protection, will be mounted as read-only

[email protected] ~]# ls?/rhel7

[[email protected] ~]# ls?/rhel7/p (tab)


2.? RHEL7 RPM Package, convenient and quick


? RPM Package MANAGER,RPM Pack Manager


–rpm-q software name ...------------------? #查询软件包是否安装

–RPM-IVH Software Name-version information. RPM ...

–RPM-E software name ...-----------------means to unload the package.



[Email protected] ~]# rpm-q Firefox

Firefox-38.3.0-2.el7_1.x86_64

[Email protected] ~]# rpm-q haha

Package haha not installed?

[Email protected] ~]# rpm-q bash

Bash-4.2.46-19.el7.x86_64

[Email protected] ~]# rpm-q vsftpd??????? #查询软件包是否安装


[Email protected] ~]# rpm-ivh/rhel7/packages/? #安装软件包 vsftpd-3.0.2-10.el7.x86_64.rpm?


[Email protected] ~]# rpm-q vsftpd???? #查询软件包是否安装成功??


[Email protected] ~]# rpm-e vsftpd???? #卸载软件包


[Email protected] ~]# rpm-q vsftpd???? #查询软件包是否卸载成功


#######################################################


Import Red Hat signature information

[Email protected] ~]# rpm--import/rhel7/rpm-gpg-key-redhat-release

?

[Email protected] ~]# rpm-q vsftpd

Vsftpd-3.0.2-10.el7.x86_64


[Email protected] ~]# rpm-e vsftpd


[Email protected] ~]# rpm-ivh/rhel7/packages/vsftpd-3.0.2-10.el7.x86_64.rpm?


[Email protected] ~]# rpm-q vsftpd


######################################################

? Yum package management, automatically resolves dependencies


?? 1. Service side, mount the optical drive device, let the system appear CD content

? [email protected] ~]# mount?/dev/cdrom? /rhel7/


?? 2. Local client, modify configuration file, specify local as server

/etc/yum.repos.d/*.repo

? [Email protected] ~]# Vim/etc/yum.repos.d/rhel7.repo


? ? ? [haha]??????????? #指明仓库名称

Name=xixi???????? #仓库描述信息

Baseurl=file:///rhel7?? #指定本地为服务端, Rhel7 Directory

Enabled=1???????? #开启本文件

Gpgcheck=0???????? #不开启签名认证


? [email protected] ~]# yum repolist?? #列出仓库信息, no error can be




Use of the Yum Warehouse

–yum clean all????? Clear Cache

–yum repolist??????//Column Warehouse


–yum-y install software name ...? ?//Install software

–yum-y Remove software name ...? ?//Uninstall Software



[email protected] ~]# Yum Clean all

[email protected] ~]# Yum repolist


[Email protected] ~]# yum-y install httpd


[[email protected] ~]# yum-y install GCC


[Email protected] ~]# yum-y install System-config-kickstart


[Email protected] ~]# rpm-q httpd

[Email protected] ~]# rpm-q gcc



[Email protected] ~]# Poweroff?



####################################################






? Three pre-configured virtual machines on each learner's machine

–classroom--provides resources such as Gateway/dns/software materials

–server--as a practice server, password Redhat

–desktop--as a practice client, password Redhat


Restore three virtual machines

[[Email protected] Desktop]# rht-vmctl Reset Classroom

[[Email protected] Desktop]# rht-vmctl Reset Server

[[Email protected] Desktop]# rht-vmctl Reset Desktop


? Operating system version:

? ? Server:cat/etc/redhat-release??? 7.0

? ? Desktop:cat/etc/redhat-release?? 7.0


? IP Address:

? ? Server:? 172.25.0.11/24

? ? Desktop:172.25.0.10/24

? ? ? ? Real machine??? :?? 172.25.0.250/24

? ? Classroom:172.25.254.254/24

??

?? True remote management of virtual machine server and desktop:

? ?

??? telnet? PlainText transmission?? TCP 23

???????????????? TCP 22


? ? ? ? ? Format: SSH? User name @ip Address

"??????" Exit Remote Login

? ? ? Ctrl+shift+t: Open a new terminal

????? common options


?????-X: Allows local running of the other's graphics program


? ? ? ? ? Format: SSH-x user name @ip address


?? True on-machine: Permanently set the alias profile

? ? ? ??

[[Email protected] Desktop]# vim?/ROOT/.BASHRC


? Alias s= ' ssh-x [email protected] '

? Alias d= ' ssh-x [email protected] '


? ?。。。。。。


[[Email protected] Desktop]# in a new terminal verification


?????????????????????????????: Redhat?


#####################################################

? Configure the Network



? Ifconfig command

–ifconfig [Interface Name]

–ifconfig-a

–ifconfig [Interface name] IPV4 address/Mask length


[[email protected] ~]# ping 127.0.0.1


[Email protected] ~]# ifconfig lo? down


[[email protected] ~]# ping 127.0.0.1


[Email protected] ~]# ifconfig?


[Email protected] ~]# ifconfig-a? #显示所有的网卡, including disabled network cards


[Email protected] ~]# ifconfig lo? up


[[email protected] ~]# ping 127.0.0.1






? Device=eth0????? #设备名

? Bootproto=none???? #手动配置

? Onboot=yes?????? #每次开机自动启用

? Ipaddr0=172.25.0.11? #IP地址

? Prefix0=24?????? #子网掩码

? gateway0=172.25.0.254? #网u关


4. Configure a permanent DNS server,/etc/resolv.conf


?? in the Linux system, the configuration file content, "#" begins with the comment text??


[[email protected] ~]# vim/etc/res (tab)


? nameserver? 172.25.254.254



##################################################


True on-Machine completion

1. Restart Nfs-server Shared Services

[Email protected] Desktop]# systemctl restart Nfs-server


2. Set nfs-server sharing service, random self-starting

[[Email protected] Desktop]# systemctl enable Nfs-server


3. Restore the Classroom virtual machine

[[Email protected] Desktop]# rht-vmctl Reset Classroom


4. Virtual Machine Validation

[email protected] ~]# Firefox 172.25.0.254




#####################################################



?? network type: Build Yum warehouse, server and client separation

? ?

? 1. The service side has been completed. Classroom build Web services, CD-ROM all content

??

? 2. On the server virtual machine, specify the Yum warehouse server.

[[email protected]/]# rm-rf/etc/yum.repos.d/*?? #删除所有客户端文件

[Email protected] ~]# vim?/etc/yum.repos.d/abc.repo

? [ABC]

? name=abc

? baseurl=http://172.25.254.254/content/rhel7.0/x86_64/dvd/

? enabled=1

? gpgcheck=0


[email protected]/]# Yum repolist


#######################################################





? Using the wget download tool


URL URLs for the –wget software package

–wget URL of the software package?-o/directory path/new file name


#? Firefox 172.25.0.254


# wget http://172.25.0.254/content/rhel7.0/x86_64/errata/Packages/kernel-3.10.0-123.1.2.el7.x86_64.rpm?

R

# uname-r------View kernel information


# RPM-IVH kernel-3.10.0-123.1.2.el7.x86_64.rpm


# reboot

# Uname-r





























Linux system Administrator Technology (Admin)-------the third day

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.