What are the differences between CentOS and Ubuntu commands?

CentOS comes from RedHat, so CentOS supports installation in rpm format, but Ubuntu obviously does not. After all, they are different distributions made by different companies, and the locations of many configuration files and the default file paths are very different. This needs to be slowly experienced during use.

Ubuntu

It is a Linux operating system based on desktop applications. Ubuntu is based on the Debian distribution and the GNOME desktop environment. The difference from Debian is that it releases a new version every 6 months.

Centos

CentOS (community ENTerprise Operating System) is one of the Linux distributions. It is compiled from the source code released by Red Hat Enterprise Linux in accordance with the open source regulations. Since it comes from the same source code, some servers that require high stability use CentOS instead of the commercial version of Red Hat Enterprise Linux.

What is the difference between CentOS and Ubuntu?

  • New non-root users in centos do not have sudo privileges. If you need to use sudo privileges, you must add the account and privileges in /etc/sudoers. So when switching to the root account, you only need to enter: su and add the root account password. In Ubuntu, you usually use sudo+command. If it is the first time to use it, you will be prompted to enter the current user's password (not the root password).
  • In online software installation, centos uses the yum command, while ubuntu uses the apt-get command. In addition, there is also a method in yum to search for a software from the software source: yum search + software name
  • CentOS comes from RedHat, so CentOS supports installation in rpm format, but Ubuntu obviously does not. After all, they are different distributions made by different companies, and the locations of many configuration files and the default file paths are very different. This needs to be slowly experienced during use.

Differences between Ubuntu and CentOS commands

The following summarizes the command differences between Ubuntu and Centos operating systems.

Basic Information

The software package suffix of Centos is *.rpm, while the software package suffix of Ubuntu is *.deb.

The configuration file of the software source is /etc/yum.conf for CentOS and /etc/apt/sources.list for Ubuntu.

Software package installation, removal, and upgrade

Centos update package list: automatically update every time yum is run

Ubuntu updates the package list: apt-get update

Centos installs the software package from the software repository: yum install package

Ubuntu installs the package from the software repository: apt-get install package

Centos installs the downloaded software package: yum install uzbox.rpm or rpm -ivh uzbox.rpm

Ubuntu installs the downloaded software package: dpkg -i uzbox.deb

Centos delete software package: yum -e package

Ubuntu removes the package: apt-get remove package

Centos package upgrade test: yum check-update

Ubuntu package upgrade test: apt-get -s update or apt-get -s dist-update

Centos package upgrade: yum update or rpm -uvh [args]

Ubuntu package upgrade: apt-get upgrade

Centos upgrade system: yum upgrade

Ubuntu upgrade system: apt-get dist-upgrade

Service Management

Centos starts the service: service httpd start

Ubuntu starts the service: /etc/init.d/apache start

Centos stop service: service httpd stop

Ubuntu stops the service: /etc/init.d/apache stop

Centos automatically runs when the system starts: chkconfig httpd on

Ubuntu automatically runs when the system starts: update-rc.d apache defaults

Centos prohibits automatic startup: chkconfig httpd off

Ubuntu prohibits automatic startup: update-rc.d apache purge

Install .deb software on CENTOS

Install alien to convert the installation package type to .rpm

yum install alien

Use alien to convert the .deb file to .rpm

alien -r XXX.deb

Installing .rpm files

rpm -ivh XXX.rpm

 

score

Leave a Reply

Your email address will not be published. Required fields are marked *