CentOS装机必备-基本设置以及缺失文件

SecureCRT中注意不要使用以Ascii方式上传文件,只有在需要的地方才使用。

 

主要是虚拟机中安装CentOS每次总会做一些设置,记录下来方便以后。

纯粹基本设置,比如本地SecureCRT可以连接虚拟机中的CentOS。

复杂的非基本设置见:Linux  命令集锦

 

安装缺失文件


下载上传命令

rz: command not found

# yum -y install lrzsz    

--------------------------------------------

安装C语言编译器gcc

cc: command not found

#yum -y install gcc


说明:-y说明安装直接选择yes

--------------------------------------------

安装C++编译器

checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.

#yum install gcc gcc-c++

--------------------------------------------

安装解压缩命令

#yum install -y unzip zip

=========================

本地windows上传shell到Linux不能执行

# yum install -y dos2unix

# yum install unix2dos

=========================

修改yum源

添加 yum 源

centos 推荐使用epel源

centos使用网易163的源和自动匹配源插件yum-fastestmirror

//先备份原来的设置,做什么修改之前都要有的习惯

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

网易centos帮助:  http://mirrors.163.com/.help/centos.html
CentOS-6
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
# yum makecache

yum-fastestmirror插件自动选择最快的yum源。
 
安装方法如下:
centos5:
# yum -y install yum-fastestmirror

 
安装之后,生成配置文件/etc/yum/pluginconf.d/fastestmirror.conf。配置文件中的hostfilepath字段,用于定义yum源的配置文件(通常是/var/cache/yum/timedhosts.txt),然后我们就可以将所知道的yum源统统写入这个txt文件,如:
 
ftp.nsysu.edu.tw
mirror01.idc.hinet.net
mirror.khlug.org
centos.vr-zone.com
ftp.stu.edu.tw
ftp.cse.yzu.edu.tw
mirror.yongbok.net
mirrors.btte.net
mirrors.sin1.sg.voxel.net
ftp.daum.net
ftp.isu.edu.tw
mirrors.163.com
mirror.neu.edu.cn
mirrors.ta139.com
ftp.oss.eznetsols.org
centos.mirror.cdnetworks.com
centos.tt.co.kr
ftp.tc.edu.tw
ftp.twaren.net
mirror.averse.net
mirror.nus.edu.sg
data.nicehosting.co.kr
 
当然,如果你的yum版本比较高,会系统会自动将常用的yum源写入此文件。
 
这样,以后我们在yum安装rpm包的时候,就可以让yum自己去选择yum源了。
目前公认较快的yum源是网易的:mirrors.163.com。

 

-----------------------------------------

如果yum源没有直接下载到本地

#yum localinstall 文件

 

下载rpm

#rpm -i 文件

-------------------------------------------

安装telnet

#yum -y install telnet

--------------------------------------------

安装lua

#yum -y install lua

#yum -y install lua-devel

----------------------------------------

phpize时提示

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

---------------------------------------------

 getcwd: cannot access parent directories的解决方法

getcwd 命令无法定位到当前工作目录。一般来说是因为你 cd 到了某个目录之后 rm 了这个目录
这时去执行某些 service 脚本的时候就会报 getcwd 。
只需要 cd 到任何一个实际存在的目录下在执行命令即可。
出现这种现象的原因还有,当前用户没有当前目录的可执行权限

----------------------------------------------

设置网络

自动连接

#cat /etc/sysconfig/network-scripts/ifcfg-eth0 ONBOOT=yes

 

重启网卡

#service network restart

 ------------------------------------------


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值