Excellent software and practical tutorials
Main Differences Between CentOS and Ubuntu
CentOS based on Linux framework and distribution that implements a free, community-supported computing platform that is compatible with the corresponding upstream source Red Hat Linux.Ubuntu is a Debian An open source Linux distribution.
In this CentOS vs Ubuntu comparison, we will aim to give an overview of the main features of both Linux distributions, which will help you choose the right operating system for your VPS web server.
Choosing an operating system for your server can be a very confusing task due to the large number of options available; especially if you want to use a Linux distribution. There are many options, but none are as famous as Ubuntu or CentOS.
Whether you are a professional or a beginner, it often comes down to choosing between the two options. It is safe to say that there is no straight forward decision. In this article, we intend to compare CentOS vs Ubuntu with the goal of finding out which one is best suited when it comes to setting up a VPS plan.
Differences between some common 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 package list | yum makecache fast | apt-get update |
4. Install software from the 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. Remove Packages | rpm -e package yum remove package | apt-get remove package apt-get purge package |
7. Get information about a software package** | yum search package | apt-cache search package |
8. All installed software is displayed | yum list installed rpm -qa | dpkg -l dpkg --list |
9. Get information about installed 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 | Root login is allowed by default | Root login is not allowed by default |
13. Create User | Create user home directory by default The default shell interpreter is bash Create password without interaction --stdin | By default, user home directories are not created. The default shell interpreter is sh Create a 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 Packages |
apt-cache show package | Get information about the package, such as description, size, version, etc. |
apt-cache depends package | Understanding usage dependencies |
apt-cache rdepends package | Check which packages the package depends on |
apt-get install package | Installing Packages |
apt-get install package --reinstall | Reinstall the package |
apt-get -f install | Repair installation "-f = --fix-missing" |
apt-get remove package | Removing a Package |
apt-get remove package --purge | Delete the package, 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 | Upgrading with dselect |
apt-get build-dep package | Install the relevant compilation environment |
apt-get source package | Download the source code for this package |
apt-get clean && apt-get autoclean | Clean up useless packages |
apt-get check | Check for broken dependencies |
CentOS/RedHat There are some differences in common commands between Debian and Ubuntu. The following lists some common commands and their usage comparison.
- apt-get vs yum: Debian/Ubuntu uses apt-get command, while CentOS/RedHat uses yum command. Both commands are tools for software package management, but they differ 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 extensible network configuration management.
- ls vs dir: Debian/Ubuntu uses ls command to list directory contents, while CentOS/RedHat uses 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 the file system, while CentOS/RedHat uses the df command.
- umount vs unmount: Debian/Ubuntu uses the umount command to unmount the 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 search for processes by process name.
- grep vs egrep: Debian/Ubuntu uses the grep command to search text, while CentOS/RedHat uses the egrep command, which provides more powerful regular expression matching capabilities.
- 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 the two Linux distributions in terms of commonly used commands. In addition, there are some differences between the two distributions in other aspects, such as file system structure, system configuration and management tools. Therefore, when performing system management and maintenance, it is necessary to choose the appropriate commands and tools according to the specific distribution and environment.