YUM (Yellowdog Updater, Modified) allows you to easily download and install software, and simplifies your installations on a CVM instance, saving you time and efforts. With it, you only need to run the yum
command to install software in the CentOS environment. Tencent Cloud provides a YUM repository so you can directly install software packages without adding sources.
Log in to your CVM instance with the root account and run the following commands to install software according to the operating system of your CVM.
dnf install [software name]
The system will automatically search for the relevant software package and dependencies, and ask for your confirmation.dnf install php
command to install PHP, the following prompt will appear:y
and press Enter to start the installation.Complete
prompt indicates the installation is completed.Note:
Starting from CentOS 7, MariaDB has become the default database in the YUM repository. If you are using CentOS 7 or later versions, MySQL installed using
yum
will be unusable. You can use the fully compatible MariaDB, or click here to learn about how to install an older version of MySQL.
yum install [software name]
The system will automatically search for the relevant software package and dependencies, and ask for your confirmation.yum install PHP
command to install PHP, the following prompt will appear:y
and press Enter to start the installation.Complete
prompt indicates the installation is completed.After software installation is completed, you can run different commands to view related information.
rpm -ql [software name]
For example, run rpm -ql php
to view the installation directory of PHP, as shown in the figure below:rpm -q
For example, run rpm -q php
to view the version of PHP, as shown in the figure below:
Was this page helpful?