Tek Eye

CentOS Version Command and Update CentOS to New Version

CentOS is a popular Linux Operating System for enterprise computing, web servers and Virtual Private Servers. CentOS may be given as a Linux option when configuring a new Virtual Private Server (VPS), online with a hosting company. This article provides a list of basic commands to help manage a CentOS VPS.

In version 7 of CentOS the hostnamectl status command can be used to find the major version and kernel version:

Check if CentOS is 64-bit or 32-bit

Since CentOS version 7 there is only the 64-bit version officially supported (although a 32-bit version is available from the community). To check if the running CentOS is 64-bit or 32-bit use the uname command with the -p option (p for processor):

List Available CentOS Updates

List available updates using yum, here piped (using |) to less to view one screen at a time, using the space bar. Use q to quit the listing:

[root@servername ~]# yum list updates | less

Update CentOS

Update CentOS using yum, package downloads may need to be confirmed with y:

[root@servername ~]# yum update

(Note: After confirming the update, the packages will download, extract and install. If this fails you may see messages such as Trying other mirrors, Error Downloading Packages and [Errno 256]. Use the command yum clean metadata and try yum update again. If it still reports errors use the command yum clean all and try again.)

Rebooting CentOS

Restart CentOS:

[root@servername ~]# reboot

Or:

[root@servername ~]# shutdown -r now

One logged back in use the commands above to check the updated versions: