Key Differences Between CentOS and Ubuntu
centos based on linux Framework and distribution that implements a free, community-supported computing platform compatible with the corresponding upstream source Red Hat Linux. In contrast,Ubuntu is a based on Debian open source Linux distribution.
In this CentOS vs Ubuntu comparison, we will aim to provide an overview of the main features of both Linux distributions which will help you web serverChoose the correct operating system.
With the vast number of options available, choosing an operating system for your server can be a very confusing task; especially if you want to use a Linux distribution. There are many options, but none as famous as Ubuntu or CentOS.
Whether you're a pro or a beginner, it often comes down to choosing between two options. It's safe to say there's no immediate decision. In this article, we're going to compare CentOS vs Ubuntu with the aim of finding out which one is best for you when setting up a VPS plan.
The difference between some commonly used commands
content | Centos 6/7 | Debian/Ubuntu |
---|---|---|
1. Software package suffix | *.rpm | *.deb |
2. Software source configuration file | /etc/yum.conf | /etc/apt/sources.list |
3. Update the package list | yum makecache fast | apt-get update |
4. Install software from software repository | yum install package | apt-get install package |
5. Install a downloaded package | yum install pkg.rpm rpm -i pkg.rpm | dpkg -i pkg.deb dpkg –install pkg.deb |
6. Delete the software package | rpm -e package yum remove package | apt-get remove package apt-get purge package |
7. Obtain information about a certain software package** | yum search package | apt-cache search package |
8. Get all installed software displayed | yum list installed rpm-qa | dpkg -l dpkg –list |
9. Get information about installed software packages | rpm -qi package | dpkg –status packages |
10. Network card configuration file | /etc/sysconfig/network-scripts/ifcfg-eth0 | /etc/network/interfaces |
11. selinux | /etc/selinux/config | no selinux |
12.SSH | Allow root login by default | Root login is not allowed by default |
13. Create user | Create user home directory by default The default shell interpreter is bash Interaction-free password creation – stdin | By default, no user home directory is created The default shell interpreter is sh Create password without interaction chpasswd |
14. Firewall Rules | Default rules | By default there are no rules |
15. Permissions | root or normal user | Default normal user permissions |
Commonly used apt-get command parameters
apt-cache search package | search package |
apt-cache show package | Get information about the package, such as description, size, version, etc. |
apt-cache depends on package | Understand usage dependencies |
apt-cache rdepends package | Check which packages this package depends on |
apt-get install package | Installation package |
apt-get install package –reinstall | Reinstall package |
apt-get -f install | Fix install "-f=–fix-missing" |
apt-get remove package | Delete package |
apt-get remove package –purge | Delete packages, including deleting configuration files, etc. |
apt-get update | update source |
apt-get upgrade | Update installed packages |
apt-get dist-upgrade | Upgrading the system |
apt-get dselect-upgrade | Upgrade with dselect |
apt-get build-dep package | Install relevant compilation environment |
apt-get source package | Download the source code of the package |
apt-get clean && apt-get autoclean | Clean up useless packages |
apt-get check | Check for broken dependencies |
CentOS/RedHat There are some differences between the two Linux distributions and Debian/Ubuntu in common commands. Some commonly used commands and their usage comparison are listed below.
- apt-get vs yum: Debian/Ubuntu uses the apt-get command, while CentOS/RedHat uses the yum command. Both commands are tools for package management, but there are differences in specific command usage and package storage management.
- top vs htop: Debian/Ubuntu uses the top command to view the real-time process status of the system, while CentOS/RedHat uses the htop command, which provides richer information and a more powerful interactive interface.
- ifconfig vs ip: Debian/Ubuntu uses the ifconfig command to view and configure network interfaces, while CentOS/RedHat uses the ip command, which provides more concise, flexible and scalable network configuration management.
- ls vs dir: Debian/Ubuntu uses the ls command to list directory contents, while CentOS/RedHat uses the dir command.
- df vs stat: Debian/Ubuntu uses the df command to view disk usage, while CentOS/RedHat uses the stat command.
- mount vs df: Debian/Ubuntu uses the mount command to mount filesystems, while CentOS/RedHat uses the df command.
- umount vs unmount: Debian/Ubuntu uses the umount command to unmount a mounted file system, while CentOS/RedHat uses the unmount command.
- ps vs pgrep: Debian/Ubuntu uses the ps command to view the current process status, while CentOS/RedHat uses the pgrep command to find the process by the process name.
- grep vs egrep: Debian/Ubuntu uses the grep command to search text, while CentOS/RedHat uses the egrep command, which provides a more powerful regular expression matching function.
- touch vs creat: Debian/Ubuntu uses the touch command to create empty files or update file timestamps, while CentOS/RedHat uses the creat command to create files or pipes.
These comparisons are not exhaustive, but are meant to illustrate the main differences between these two Linux distributions in commonly used commands. In addition, there are some differences between the two distributions in other areas, such as file system structure, system configuration, and management tools. Therefore, when performing system management and maintenance, it is necessary to select appropriate commands and tools according to the specific distribution and environment.