标签:tis 关系 shel 区分 only 相互 ext roc update
在Linxu系统中,主机名大多保存在/etc/hostname文件中。
//使用vim修改/etc/hostname中的内容
[root@rockman ~]# vim /etc/hostname
[root@rockman ~]# cat /etc/hostname
rockman.com
[root@rockman ~]# hostname
rockman.com
YPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=1a497aa0-f2c5-449d-96ed-e15df4ddf8b3
DEVICE=ens33
ONBOOT=yes
[root@rockman network-scripts]# systemctl restart network
[root@rockman network-scripts]# ping baidu.com
PING baidu.com (123.125.115.110) 56(84) bytes of data.
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=1 ttl=128 time=5.48 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=2 ttl=128 time=5.47 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=3 ttl=128 time=6.71 ms
64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=4 ttl=128 time=5.42 ms
^C
--- baidu.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
可以把Yum想象成一个硕大的软件仓库,里面保存有几乎所有的常用工具,而且只需要说出所需的软件包名称,系统就会为你搞定一切。
[root@rockman network-scripts]# cd /etc/yum.repos.d/
[root@rockman yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@rockman yum.repos.d]# vi CentOS-Media.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@linuxprobe yum.repos.d]# mkdir -p /media/cdrom
[root@linuxprobe yum.repos.d]# mount /dev/cdrom /media/cdrom
mount: /dev/sr0 is write-protected, mounting read-only
[root@linuxprobe yum.repos.d]# vim /etc/fstab
/dev/cdrom /media/cdrom iso9660 defaults 0 0
[root@rockman network-scripts]# yum install httpd -y
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/2): extras/7/x86_64/primary_db | 149 kB 00:00
(2/2): updates/7/x86_64/primary_db | 2.0 MB 00:01
Loading mirror speeds from cached hostfile
(省略部分输出信息)
Complete!
标签:tis 关系 shel 区分 only 相互 ext roc update
原文地址:https://www.cnblogs.com/rock-cc/p/9183357.html