Linux安装系统注意事项及系统初始化

        Linux安装系统注意事项

 

        1.分区

        学习用途:

        /boot:200M

        /swap :内存的1到2倍

        /:根据需要分配大小,比如虚拟机下总空间是15G,那么可以分配8——10G跟/分区,如果是生产环境,60——100G都很正常

        /opt:最好有个单独的分区,用以存储数据、资料,下次使用系统此分区保持不变,就不会丢失数据。

        2.根据需要安装工具包。

        3. 学习使用的话尽可能最小化安装,只需要在最小化的基础上安装中文支持包即可。

 

 

        系统初始化

        1.修改主机名字

 

[root@localhost Desktop]# vim /etc/sysconfig/network

[root@localhost Desktop]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=larrywen.host.com

[root@localhost Desktop]# hostname
localhost.localdomain

[root@localhost Desktop]# hostname larrywen.host.com
[root@localhost Desktop]# hostname
larrywen.host.com
#修改完后重启系统或者关闭终端,再次执行hostname修改就可以看到效果


        2.配置网络

[root@larrywen ~]# vi /etc/sysconfig/network-scripts/
#局域网,配置IPADDR和NETMASK即可

        3.关闭安全相关的比如SELINUX防火墙

[root@larrywen ~]# chkconfig NetworkManager off
[root@larrywen ~]# chkconfig iptables off
[root@larrywen ~]# chkconfig ip6tables off

[root@larrywen ~]# /etc/init.d/iptables stop
[root@larrywen ~]# /etc/init.d/ip6tables stop


[root@larrywen ~]# setenforce 0
#将SELINUX有enabled改为permissive
[root@localhost ~]# grep "^SELINUX=" /etc/sysconfig/selinux -n
8:SELINUX=permissive

        4.yum源的配置

[root@localhost ~]# mkdir /iso
mount /dev/cdrom /iso
cd /iso
ll
[root@localhost iso]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo iso.repo

[root@localhost yum.repos.d]# cat iso.repo 
[rhel-iso]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///iso
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@localhost yum.repos.d]# yum install vim man -y

#mount后重启失效,要想永久生效,添加此句话
[root@localhost yum.repos.d]# echo "mount /dev/cdrom /iso" >> /etc/rc.local 
[root@localhost yum.repos.d]# cat /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
mount /dev/cdrom /iso

        5.其他可以自行配置,比如启用中文输入法、修改终端字体和颜色等等



  我的邮箱wgbno27@163.com
  新浪微博@Wentasy27         
  微信公众平台:JustOracle(微信号:justoracle)
  数据库技术交流群:336882565(加群时验证 From CSDN XXX)
  Oracle交流讨论组https://groups.google.com/d/forum/justoracle
  By Larry Wen


katoonSina CSDN
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值