RHEL vs ubuntu
RHEL vs ubuntu
Table of Contents
Differences
Packages
yum vs apt
rpm vs dpkg
Service
OS configuration files
Log
Differences
Note RHEL Ubuntu
Support 10years 10years LTS(Long Term Support)
Defautl Editor vi nano
Access control SELinux AppArmor
Apach HTTP Server httpd apache2
Firewall firewalld (CentOS7) ufw(Uncomplicated FireWall)
iptables (CentOS5, 6)
Packages
yum vs apt
The apt command is a command for integration of apt-get / apt-cache. Let's use only apt from now on.
Note CentOS Ubuntu
Repository configuration file /etc/yum.repos.d/*.repo /etc/apt/sources.list
Repository configuration file /etc/yum.conf /etc/apt/apt.conf (Create)
Proxy Configuration
Acquire::http::Proxy
"http://x.x.x.x:8888/";
Package search yum search STRINGS apt search STRINGS
Package search apt list PACKAGE
apt list php
Package Detail yum info PACKAGE apt show PACKAGE
apt show php
Package installation yum install PACKAGE apt install PACKAGE
apt -f install PACAGE ← Repair broken
dependencies
Package uninstall yum remove PACKAGE apt purge PACKAGE
List of repositories yum list apt list
Repository update Automatic update every time apt update ← In Ubuntu you need to do
Update installed packages apt-get upgrade
rpm vs dpkg
Note CentOS Ubuntu
Package installation rpm -i PACKAGE.rpm dpkg -i PACKAGE.deb
List of installed packages rpm -qa dpkg -l |grep XXX
rpm -qa |grep xxx dpkg -l |grep ^ii
(Also show deleted packages)
Confirm installed package rpm -q PACKAGE dpkg -l PACKAGE
List of files included in package rpm -ql PACKAGE dpkg -L PACKAGE
Note CentOS Ubuntu
Package confirmation including file rpm -qf PACKAGE dpkg -S PACKAGE
Package uninstall rpm -e PACKAGE dpkg -P PACKAGE
Service
Note CentOS6 CentOS7 Ubuntu
Service status check service SERVICE status systemctl UNIT status service SERVICE status
/etc/init.d/SERVICE status /etc/init.d/SERVICE status
Start service service SERVICE start systemctl UNIT start service SERVICE start
/etc/init.d/SERVICE start /etc/init.d/SERVICE start
Stop service service SERVICE stop systemctl UNIT stop service SERVICE stop
/etc/init.d/SERVICE stop /etc/init.d/SERVICE stop
Automatic start setting chkconfig --list ls -l /etc/rc*.d/
confirmation sysv-rc-conf --list
(apt-get install sysv-rc-conf)
Automatic start enable chkconfig SERVICE on systemctl enable update-rc.d SERVICE enable
UNIT
Disable auto start chkconfig SERVICE off systemctl enable update-rc.d SERVICE disable
UNIT
Auto start service added chkconfig --add SERVICE insserv -d SERVICE
Automatic start service chkconfig --del SERVICE insserv -r SERVICE
deletion
Service setting file /etc/sysconfig/SERVICE /etc/default/SERVICE
Individual service
Note CentOS Ubuntu
Apache/httpd /etc/httpd/ /etc/apache2/apache2.conf
httpd.conf
mysql /etc/my.cnf /etc/mysql/my.cnf
php /etc/php.ini /etc/php5/apache2/php.ini(For the web)
/etc/php5/cli/php.ini(For Command)
/etc/php5/conf.d/*.ini(For the web adn Command)
OS configuration files
Note CentOS Ubuntu
OS Version /etc/redhat-release /etc/lsb-release
/etc/issue /etc/issue
Tips:cat /etc/*release Tips:cat /etc/*release
Hostname /etc/sysconfig/network /etc/hostname
Network Interfaces /etc/sysconfig/network- /etc/network/interfaces
scripts/ifcfg-X
Example
/etc/sysconfig/network-
scripts/ifcfg-eth0
Defautlt Gateway Configuration /etc/sysconfig/network /etc/network/interfaces
Run Level /etc/inittab
Lang /etc/sysconfig/i18n /etc/default/locale
Modification method
update-locale
LANG=ja_JP.UTF-8
Check Locale
locale #Confirm current locale
localectl list-locales #List of
available locales
Note CentOS Ubuntu
apt install language-pack-ja
Timezone Modification method
dpkg-reconfigure tzdata
Keybord /etc/sysconfig/keyboard /etc/default/keyboard
Modification method
dpkg-reconfigure keyboard-
configuration
cron /var/spool/cron/USER /var/spool/cron/crontabs/USER
No difference file
Note CentOS Ubuntu
DNS /etc/resolv.conf /etc/resolv.conf
hosts /etc/hosts /etc/hosts
Log
Note CentOS Ubuntu
syslog /var/log/messages /var/log/syslog
Audit /var/log/secure /var/log/auth.log
log
mail log /var/log/maillog /var/log/mail.log
cron log /var/log/cron /var/log/syslog
S.NO. Ubuntu Red Hat Linux/RHEL
Ubuntu is for general use or server RHEL is generally business oriented or for
5. use. commercial use.