Download CentOS. As you download and use CentOS Linux, the CentOS Project invites you to be a part of the community as a contributor. There are many ways to contribute to the project, from documentation, QA, and testing to coding changes for SIGs, providing mirroring or hosting, and helping other users.
Table of Contents This module is a step by step demonstration of an actual installation of CentOS 7. We start by downloading an image from the internet and install CentOS 7 as a virtual machine in Virtualbox. We will also do some basic configuration of this new machine like setting an ip address and fixing a hostname. This procedure should be very similar for other versions of CentOS, and also for distributions like RHEL (Red Hat Enterprise Linux) or Fedora.
This procedure can also be helpful if you are using another virtualization solution. Verify the size of the file after download to make sure it is complete. Probably a right click on the file and selecting 'properties' (if you use Windows or Mac OSX).
I use Linux on the laptop already: paul@debian8:$ ls -lh CentOS-7.0-1406-x8664-Minimal.iso -rw-r-r- 1 paul paul 566M Nov 1 14:45 CentOS-7.0-1406-x8664-Minimal.iso Do not worry if you do no understand the above command. Just try to make sure that the size of this file is the same as the size that is mentioned on the CentOS 7 website.
All subsequent screenshots will be text only, no images anymore. For example this screenshot shows three commands being typed on my new CentOS 7 install. root@localhost # who am i root pts/0 2014-11-01 22:14 root@localhost # hostname localhost.localdomain root@localhost # date Sat Nov 1 22:14:37 CET 2014 When using ssh the same commands will give this screenshot: root@localhost # who am i root pts/0 2014-11-01 21:00 (192.168.1.35) root@localhost # hostname localhost.localdomain root@localhost # date Sat Nov 1 22:10:04 CET 2014 root@localhost # If the last part is a bit too fast, take a look at the next topic CentOS 7 first logon. Setting the hostname Setting the hostname is a simple as changing the /etc/hostname file. As you can see here, it is set to localhost.localdomain by default. root@localhost # cat /etc/hostname localhost.localdomain You could do echo server33.netsec.local /etc/hostname followed by a reboot.
![How To Install Centos Linux How To Install Centos Linux](/uploads/1/2/5/6/125604717/181733792.png)
But there is also the new CentOS 7 way of setting a new hostname. root@localhost # nmtui The above command will give you a menu to choose from with a set system hostname option. Using this nmtui option will edit the /etc/hostname file for you. root@localhost # cat /etc/hostname server33.netsec.local root@localhost # hostname server33.netsec.local root@localhost # dnsdomainname netsec.local For some reason the documentation on the centos.org and docs.redhat.com websites tell you to also execute this command: root@localhost # systemctl restart systemd-hostnamed. Virtualbox network interface By default Virtualbox will connect your virtual machine over a nat interface. This will show up as a 10.0.2.15 (or similar). You can make this change while the vm is running, provided that you execute this command: root@server33 # systemctl restart network root@server33 # ip a s dev enp0s3 2: enp0s3: mtu 1500 qdisc pfifofast s tate UP qlen 1000 link/ether 08:00:27:1c:f5:ab brd ff:ff:ff:ff:ff:ff inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3 validlft 7199sec preferredlft 7199sec inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link validlft forever preferredlft forever root@server33 #.
Configuring the network The new way of changing network configuration is through the nmtui tool. If you want to manually play with the files in /etc/sysconfig/network-scripts then you will first need to verify (and disable) NetworkManager on that interface. Verify whether an interface is controlled by NetworkManager using the nmcli command (connected means managed bu NM).
root@server33 # nmcli dev status DEVICE TYPE STATE CONNECTION enp0s3 ethernet connected enp0s3 lo loopback unmanaged - Disable NetworkManager on an interface (enp0s3 in this case): echo 'NMCONTROLLED=no' /etc/sysconfig/network-scripts/ifcfg-enp0s3 You can restart the network without a reboot like this: root@server33 # systemctl restart network Also, forget ifconfig and instead use ip a. root@server33 # ip a s dev enp0s3 grep inet inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3 inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link root@server33 #. Adding one static ip address This example shows how to add one static ip address to your computer. root@server33 # nmtui edit enp0s3 In this interface leave the IPv4 configuration to automatic, and add an ip address just below. IPv4 CONFIGURATION Addresses 10.104.33.32/16 Execute this command after exiting nmtui. root@server33 # systemctl restart network And verify with ip (not with ifconfig): root@server33 # ip a s dev enp0s3 grep inet inet 192.168.1.110/24 brd 192.168.1.255 scope global dynamic enp0s3 inet 10.104.33.32/16 brd 10.104.255.255 scope global enp0s3 inet6 fe80::a00:27ff:fe1c:f5ab/64 scope link root@server33 #. Package management Even with a network install, CentOS 7 did not install the latest version of some packages.
![How To Install Centos Linux How To Install Centos Linux](/uploads/1/2/5/6/125604717/329767482.png)
Luckily there is only one command to run (as root). This can take a while. root@server33 # yum update Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile. base: centos.weepeetelecom.be.
extras: centos.weepeetelecom.be. updates: centos.weepeetelecom.be Resolving Dependencies - Running transaction check - Package NetworkManager.x8664 1:0.9.9.1-13.git20140326.4dba720.el7 will be updated. (output truncated) You can also use yum to install one or more packages. Do not forget to run yum update from time to time. root@server33 # yum update -y && yum install vim -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile. base: centos.weepeetelecom.be. (output truncated) Refer to the package management chapter for more information on installing and removing packages.