Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • See all Red Hat products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Red Hat OpenShift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • See all technologies
    • Programming languages & frameworks

      • Java
      • Python
      • JavaScript
    • System design & architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer experience

      • Productivity
      • Tools
      • GitOps
    • Automated data processing

      • AI/ML
      • Data science
      • Apache Kafka on Kubernetes
    • Platform engineering

      • DevOps
      • DevSecOps
      • Red Hat Ansible Automation Platform for applications and services
    • Secure development & architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & cloud native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • See all learning resources

    E-books

    • GitOps cookbook
    • Podman in action
    • Kubernetes operators
    • The path to GitOps
    • See all e-books

    Cheat sheets

    • Linux commands
    • Bash commands
    • Git
    • systemd commands
    • See all cheat sheets

    Documentation

    • Product documentation
    • API catalog
    • Legacy documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore the Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Preparing CentOS 6.8 for Work

March 14, 2017
Sergey Iryupin
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    I came across Linux in 2005, it was Debian. Then followed a love affair with Ubuntu, for which in March 2009 I purchased a netbook Asus EeePC 1000. In 2010, I began to contribute to ALT Linux participating in the “School Project” and even became a basic256 package maintainer.

    The last few years my EeePC with Ubuntu peacefully rested deep in my cupboard. Then there was a chance to clean off the dust. There was a task to get acquainted with CentOS Linux and test examples for my webinar “Apache Ant – quick start”.

    Visiting centos.org, I stop at version 6.8. On http://isoredirect.centos.org/altarch/7/isos/i386/ page I selected the server with disk images and download files CentOS-6.8-i386-LiveCD.iso. With the help of Rufus create a bootable USB and successfully install the CentOS 6.8 on my Asus EeePC. The process is very simple. The dark-blue colors of the good old GNOME are pleasing to my eyes.

    What tools (programs/packages) do I need? So far, I need only three: Java JDK, Apache Ant, and Git. I begin to synchronize and update package index files, keeping in mind that instead of apt-get (in Ubuntu) on CentOS they use yum:

    [lamp@localhost ~]$ sudo yum update
    [sudo] password for lamp:
    lamp is not in the sudoers file. This incident will be reported.

    Here is the news… Unlike Ubuntu, the unprivileged user cannot use by default via sudo the commands with root privilege. Learning https://wiki.centos.org/TipsAndTricks/BecomingRoot I decide to use the “quick and dirty way” by editing the file /etc/sudoers. To do this the root has visudo command (thanks to tips of experienced colleagues). I pass on in the root account (after su command I enter the root password, which I have set during the installation):

    [lamp@localhost ~]$ su
    Password:
    [root@localhost lamp]# visudo

    I find the line “root ALL=(ALL) ALL” in the file and add (pre-pressing the “I” and entering into insert mode) a similar line, but instead of root I'm writing lamp, it turns this way:

    root ALL=(ALL) ALL
    lamp ALL=(ALL) ALL

    I press Esc and go out with saving (:wq). I leave root account using exit. Now I can give privilege using sudo and my password. And I repeat:

    [lamp@localhost ~]$ sudo yum update
    [sudo] password for lamp:

    I enter my password, everything works. The yum updates indexes, and offers to upgrade some packages by downloading about 197 MB. I answer N (No); it can wait a little.

    Time turn to Java JDK. In front of me, there is a dilemma: install the oracle-jdk or openjdk. Thanks to the advice of more experienced colleagues I'm inclined to get openjdk. I use the command yum search to find the name of the package to be installed. Surely, I take the latest version:

    [lamp@localhost ~]$ sudo yum search jdk
    ...
    java-1.8.0-openjdk-devel.i686 : OpenJDK Development Environment
    ...
    [lamp@localhost ~]$ sudo yum install java-1.8.0-openjdk-devel
    ...
    [lamp@localhost ~]$ javac -version
    javac 1.8.0_121
    [lamp@localhost ~]$ java -version
    openjdk version "1.8.0_121"
    OpenJDK Runtime Environment (build 1.8.0_121-b13)
    OpenJDK Server VM (build 25.121-b13, mixed mode)

    JDK is there, now it is the time for Apache Ant. I'm trying to get it from a repository:

    [lamp@localhost ~]$ sudo yum install ant

    …in addition, yum offers to download about 60 MB and install 10 dependency packages, where ant takes only 2.2 MB. However, Google slightly hints – is will be the version 1.7.1 which does not suit me at all (it nas no junit). After a short search, I find a suitable script that allows me to download and install the latest version. I edit it a little for myself:

    # download and install
    antname=apache-ant
    antserver=http://apache-mirror.rbc.ru/pub/apache
    antversion=1.10.1
    wget ${antserver}/ant/binaries/${antname}-${antversion}-bin.tar.gz
    sudo tar xvfvz ${antname}-${antversion}-bin.tar.gz -C /opt
    sudo ln -sfn /opt/${antname}-${antversion} /opt/ant
    sudo sh -c 'echo ANT_HOME=/opt/ant >> /etc/environment'
    sudo ln -sfn /opt/ant/bin/ant /usr/bin/ant

    # check installation
    ant -version

    # cleanup
    rm ${antname}-${antversion}-bin.tar.gz

    I save the script in the home directory and then run:

    [lamp@localhost ~]$ chnod +x installantoncentos.sh
    [lamp@localhost ~]$ ./installantoncentos.sh

    I see the last line, which is the result of ant -version command:

    Apache Ant(TM) version 1.10.1 compiled on February 2 2017

    I take Git from the repository:

    [lamp@localhost ~]$ sudo yum install git
    [lamp@localhost ~]$ git --version
    git version 1.7.1

    So, the tools are ready and I can start testing examples for my webinar. But this is another story…


    As a developer, you can get a no-cost Red Hat Enterprise Linux Developer Suite subscription, which includes Red Hat Enterprise Linux 7 server, a collection of development tools, and much more.

    Last updated: October 20, 2023

    Recent Posts

    • Automate VM golden image builds for OpenShift with Packer

    • Setting up Intel TDX VMs with Trustee on OpenShift

    • Building and running Request Tracker as a quadlet container

    • Use OpenShift Lightspeed with locally served LLMs to drive security-focused, cost-efficient enterprise solutions for Red Hat products

    • 3 MCP servers you should be using (safely)

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue