📜 ⬆️ ⬇️

I prepare CentOS 6.8 for work

We crossed with Linux in 2005, it was Debian . Then came a long love affair with Ubuntu , for which, in March 2009, I purchased the Asus EeePC 1000 netbook. In 2010, I began working with ALT Linux , participated in the School Project ( promoted Linux in schools ), and became the main256 maintainer .

For the past few years, my EeePC with Ubuntu has been relaxing peacefully in the back of the closet. And then there was a reason to shake off the dust. There was a task to get acquainted with CentOS Linux and test examples for the Apache Ant webinar there.

Having visited www.centos.org , I stop at version 6.8. On the page I select a server with disk images and download the file CentOS-6.8-i386-LiveCD.iso. Using Rufus, I create a bootable USB and successfully install CentOS 6.8 onto my Asus EeePC. The process is very simple. And the good blue glamor of the good old GNOME is pleasing to the eye ...

What tools (software / packages) do I need? So far, only three: Java JDK , Apache Ant and Git . I start by synchronizing and updating the package index files, bearing in mind that instead of apt-get (in Ubuntu), CentOS uses yum :
')
[lamp @ localhost ~] $ sudo yum update
[sudo] password for lamp:
lamp is not in the sudoers file. This incident will be reported.

This is news ... Unlike Ubuntu, a simple user does not have the rights to execute commands as root. After studying wiki.centos.org/TipsAndTricks/BecomingRoot , I decide to use the “ quick and dirty way ” by editing the / etc / sudoers file. To do this, root has a visudo command (thanks to experienced colleagues). I switch to root mode (after su I enter root the password specified during installation):

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

I find the root line ALL = (ALL) ALL in the file and add (after pressing the "I" key and entering the insert mode) below a similar line, but instead of writing the root I write lamp , it turns out like this:

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

I press Esc and exit the file with saving (: wq). I leave the root mode with the exit command . You can now execute administrative commands through sudo by entering a user password. So again:

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

I enter the password, everything works, yum updates the indexes and at the same time offers to update some packages by downloading 197 MB. I answer N, it will wait a little.

Time to do Java JDK . I have a choice - to put oracle-jdk or open-jdk? Thanks to the advice of more experienced colleagues, the balance leans towards open-jdk . I use the yum search command to find the package name for the installation. I put, of course, 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, queue for Apache Ant . I try to put from the repository:

[lamp @ localhost ~] $ sudo yum install ant

and yum offers to download about 60 MB and install 10 dependency packages, where the ant itself is only 2.2 MB. At the same time, Google slightly hints - this is version 1.7.1, which does not suit me at all (there is no junit). After a short search, I find a suitable script that allows you to download and install the latest version. Slightly edit it for yourself:

# 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 

and save to the home directory, then run:

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

in the last line I see the result of the ant -version command :

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

Git from the repository:

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

So, the necessary tools are ready and you can start testing examples for the webinar. But it will be another story ...

Source: https://habr.com/ru/post/323246/


All Articles