博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS装机必备-基本设置以及缺失文件
阅读量:2085 次
发布时间:2019-04-27

本文共 2560 字,大约阅读时间需要 8 分钟。

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

 

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

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

复杂的非基本设置见:

 

安装缺失文件

下载上传命令

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源

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

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

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

网易centos帮助: 

CentOS-6
# wget -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文件,如:
 
mirror01.idc.hinet.net
mirror.khlug.org
centos.vr-zone.com
mirror.yongbok.net
mirrors.btte.net
mirrors.sin1.sg.voxel.net
mirrors.163.com
mirror.neu.edu.cn
mirrors.ta139.com
centos.mirror.cdnetworks.com
centos.tt.co.kr
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

# 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

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

转载地址:http://bdzvf.baihongyu.com/

你可能感兴趣的文章
CodeForces - 996D Suit and Tie (暴力)
查看>>
ACM 2017 香港区域赛 E - Base Station Sites(二分)
查看>>
ACM 2018 青岛区域赛 J-Books (模拟)
查看>>
ACM 2016 沈阳区域赛 E - Counting Cliques (dfs)
查看>>
ACM 2017 北京区域赛 J-Pangu and Stones(区间dp)
查看>>
HDU - 5643 King's Game (约瑟夫环变式)
查看>>
UVA - 1452 Jump (约瑟夫环变式)
查看>>
POJ - 3517 And Then There Was One (约瑟夫环变式)
查看>>
HDU - 2068 RPG的错排 (错排+组合数)
查看>>
CodeForces 591C Median Smoothing(思维 模拟)
查看>>
升级yosemite后java出错的解决
查看>>
Spring Cloud Spring Boot b2b2c 微服务 多商家入驻直播商城之Maven 项目模板
查看>>
mac || Linux 命令行下实现批量重命名
查看>>
java常用类 String面试题
查看>>
Windows10下的powershell美化教程
查看>>
利用ffmpeg合并音频和视频
查看>>
刷好老毛子系统进不了老毛子系统后台的解决办法
查看>>
Parallels Desktop 16 不能联网的解决办法
查看>>
ERROR 1292 (22007): Incorrect datetime value: ‘2002‘ for column ‘出版日期‘ at row 1
查看>>
SLAM中TUM数据集更改图片名字
查看>>