Ubuntu 与 Centos常见使用区别

以前是搞Centos的,无赖现公司生产环境使用的是Ubuntu,记录下常见使用情况下的一些不同点.....:

  • 软件安装管理:

Centos使用yum install,Ubuntu使用apt-get install

Centos搜索已安装软件使用rpm -q,Ubuntu使用apt-cache search 

Ubuntu默认文本编辑器为nano,使用系统管理工具可修改默认编辑器update-alternatives --config editor

  • 网卡配置文件:

Centos网卡配置文件目录在/etc/sysconfig/network-scripts/网卡名

Ubuntu网卡配置文件目录在/etc/network/interfaces

配置示例:

Centos

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens33

UUID=9936589f-50ac-4e23-b64a-a8a31abfdd91

DEVICE=ens33

ONBOOT=yes

IPADDR=192.168.254.129

PREFIX=255.255.255.0

GATEWAY=192.168.254.2

ZONE=

Ubuntu(重启网络服务sudo systemctl restart networking)

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

 

source /etc/network/interfaces.d/*

 

# The loopback network interface

auto lo

iface lo inet loopback

 

# The primary network interface

auto ens33

iface ens33 inet static

address 192.168.254.128

netmask 255.255.255.0

gateway 192.168.254.2

dns-nameservers 114.114.114.114

  • Ubuntu使用国内163源:

以下部分加入/etc/apt/source.list文件最前端,注意备份。

deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse

  • 系统相关日志(默认)

系统默认日志路径配置文件:/etc/rsyslog.d/50-default.conf

/var/log/syslog                  系统日志

/var/log/auth.log              所有和用户认证相关的日志

/var/log/kern.log               系统内核日志

 

发布了16 篇原创文章 · 获赞 3 · 访问量 2239

猜你喜欢

转载自blog.csdn.net/OthersOnlyMe/article/details/102897544