Skip to content

Centos

Centos is a redhat flavor linux,

mate desktop

Of course you are forced to use the unusable desktops by default but let's just revert that right now.

  • Do not use use any of the 'classic' sessions they are equally horrible
  • use MATE Desktop always.
install mate
sudo yum install @MATE

You will probably still not have the correct desktop after this, but it's set in the file /var/lib/AccountsService/users/kees

/var/lib/AccountsService/users/kees
1
2
3
4
5
[User]
Language=
XSession=mate
Icon=/home/kees/.face
SystemAccount=false

It will not exist until you log in at least once. Sometimes you get a little gear icon next to the login button where you can set mate as well, otherwise edit this file and log in again.

yum repositories

The main base is /etc/yum* for instance :

config
/etc/yum.conf 

Is for the main settings

repository files
/etc/yum.repos.d/*

Is a directory for additional repositories, for instance see "install chrome" later in this page. To solve problems with messages like :

error
"Repository X is listed more than once in the configuration"

You can run this command to list all repositories :

list repositories
yum repolist all

A useful setting for yum.conf, because yum will retry 10 times 30 seconds when it cannot reach repositories, you could tune that down :

retry
retries=2
timeout=10

Note that the first time counts as a 'try' so this will try 3 times, fill in retries=0 for 1 time only.

determine mirrors
[visit](pre)
Loaded plugins: dellsysid, fastestmirror
Repository rinis is listed more than once in the configuration
Determining fastest mirrors
base                                                                                                                                        | 3.7 kB     00:00
base/primary_db                                                                                                                             | 4.6 MB     00:09
centosplus                                                                                                                                  | 3.4 kB     00:00
centosplus/primary_db                                                                                                                       | 577 kB     00:01
contrib                                                                                                                                     | 2.9 kB     00:00
contrib/primary_db                                                                                                                          | 1.2 kB     00:00
dell-omsa-indep                                                                                                                             | 1.9 kB     00:00
dell-omsa-indep/primary_db                                                                                                                  | 514 kB     00:01
dell-omsa-specific                                                                                                                          | 1.9 kB     00:00
dell-omsa-specific/primary_db                                                                                                               | 1.1 kB     00:00
extras                                                                                                                                      | 3.4 kB     00:00
extras/primary_db                                                                                                                           |  29 kB     00:00
rinis                                                                                                                                       |  951 B     00:00
rinis/primary                                                                                                                               | 5.3 kB     00:00
rinis                                                                                                                                                        21/21
updates                                                                                                                                     | 3.4 kB     00:00
updates/primary_db                                                                                                                          | 967 kB     00:01
repo id                                                       repo name                                                                               status
C6.0-base                                                     CentOS-6.0 - Base                                                                       disabled
C6.0-centosplus                                               CentOS-6.0 - CentOSPlus                                                                 disabled
C6.0-contrib                                                  CentOS-6.0 - Contrib                                                                    disabled
C6.0-extras                                                   CentOS-6.0 - Extras                                                                     disabled
C6.0-updates                                                  CentOS-6.0 - Updates                                                                    disabled
C6.1-base                                                     CentOS-6.1 - Base                                                                       disabled
C6.1-centosplus                                               CentOS-6.1 - CentOSPlus                                                                 disabled
C6.1-contrib                                                  CentOS-6.1 - Contrib                                                                    disabled
C6.1-extras                                                   CentOS-6.1 - Extras                                                                     disabled
C6.1-updates                                                  CentOS-6.1 - Updates                                                                    disabled
C6.2-base                                                     CentOS-6.2 - Base                                                                       disabled
C6.2-centosplus                                               CentOS-6.2 - CentOSPlus                                                                 disabled
C6.2-contrib                                                  CentOS-6.2 - Contrib                                                                    disabled
C6.2-extras                                                   CentOS-6.2 - Extras                                                                     disabled
C6.2-updates                                                  CentOS-6.2 - Updates                                                                    disabled
C6.3-base                                                     CentOS-6.3 - Base                                                                       disabled
C6.3-centosplus                                               CentOS-6.3 - CentOSPlus                                                                 disabled
C6.3-contrib                                                  CentOS-6.3 - Contrib                                                                    disabled
C6.3-extras                                                   CentOS-6.3 - Extras                                                                     disabled
C6.3-updates                                                  CentOS-6.3 - Updates                                                                    disabled
C6.4-base                                                     CentOS-6.4 - Base                                                                       disabled
C6.4-centosplus                                               CentOS-6.4 - CentOSPlus                                                                 disabled
C6.4-contrib                                                  CentOS-6.4 - Contrib                                                                    disabled
C6.4-extras                                                   CentOS-6.4 - Extras                                                                     disabled
C6.4-updates                                                  CentOS-6.4 - Updates                                                                    disabled
C6.5-base                                                     CentOS-6.5 - Base                                                                       disabled
C6.5-centosplus                                               CentOS-6.5 - CentOSPlus                                                                 disabled
C6.5-contrib                                                  CentOS-6.5 - Contrib                                                                    disabled
C6.5-extras                                                   CentOS-6.5 - Extras                                                                     disabled
C6.5-updates                                                  CentOS-6.5 - Updates                                                                    disabled
base                                                          RINIS-6 - Base                                                                          enabled: 6518
base-debuginfo                                                CentOS-6 - Debuginfo                                                                    disabled
c6-media                                                      CentOS-6 - Media                                                                        disabled
centosplus                                                    RINIS-6 - Plus                                                                          enabled:   26
contrib                                                       RINIS-6 - Contrib                                                                       enabled:    0
dell-omsa-indep                                               Dell OMSA repository - Hardware independent                                             enabled: 2687
dell-omsa-specific                                            Dell OMSA repository - Hardware specific                                                enabled:    0
extras                                                        RINIS-6 - Extras                                                                        enabled:   35
fasttrack                                                     CentOS-6 - fasttrack                                                                    disabled
rinis                                                         RINIS-6 - Repository                                                                    enabled:   21
updates                                                       RINIS-6 - Updates                                                                       enabled:  477
repolist: 9764
[visit](/pre)

However this did not help me in this case, which was with the [rinis] repository so the second tool is simply:

ls
ls -l /etc/yum.repos.d

Which gave :

output
-rw-r--r--. 1 root root 1198 Nov  7 12:50 CentOS-Base.old
-rw-r--r--  1 root root 1223 Dec 11 11:54 CentOS-Base.repo
-rw-r--r--. 1 root root 1991 Oct 23 13:41 CentOS-Base.repo.rpmnew
-rw-r--r--. 1 root root  647 Oct 23 13:41 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  630 Oct 23 13:41 CentOS-Media.repo
-rw-r--r--. 1 root root 5394 Oct 23 13:41 CentOS-Vault.repo
-rw-r--r--. 1 root root  289 Oct 23 13:41 CentOS-fasttrack.repo
-rw-r--r--  1 root root  105 Dec 11 11:54 RINIS.net.repo
-rw-r--r--. 1 root root  112 Nov  7 12:50 RINIS.nl.repo
-rw-r--r--  1 root root  940 Dec 11 11:55 dell-omsa-repository.repo

Clearly, RINIS.net.rep AND RINIS.nl.rep was a bit too much.

vbox guest additions

I did not get the resolution up to par the first couple of times, this guide helped a lot :

Welcome to the CentOS forums. Reading FAQ & Readme First is recommended for new users.

Not sure where you may be going wrong as the instructions you cite seem pretty clear, but the first couple of steps below may be missing. It goes like this.

  1. Read Installing Software and Repositories, and note the warnings and advice about installing and configuring the yum priorities plugin.
  2. Become root.
  3. Configure the RPMforge repo (or EPEL).
  4. "yum install dkms" - should pull in required dependencies if not installed.
  5. Pick "Install Guest Additions..." from the VirtualBox "Devices" menu.
  6. Mount /dev/cdrom on a convenient mount point, if it does not automount in a GUI environment.
  7. "cd /mount/point" - wherever it is mounted.
  8. "sh ./VBoxLinuxAdditions-x86.run" or "sh ./VBoxLinuxAdditions-amd64.run" for i386 or x86_64 installations respectively.
  9. Reboot.

Additional, make sure you match the kernel and the kernel sources because the vbox installer uses uname to get the exact kernel version.

centos 6

6.5 is the last version in the 6 series, if you install this under virtualbox, save yourself some trouble and update virtualbox to the latest from the oracle site. The guest additions will install directly from version 4.3 , not from the version that debian provides (4.1)

install chrome :

Again it does not install out of the box, create a file called :

chrome
/etc/yum.repos.d/google-chrome.repo

With these contents :

/etc/yum.repos.d/google-chrome.repo
1
2
3
4
5
6
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Then install it with :

install
yum install google-chrome

network

The network scripts are located in /etc/sysconfig/network-scripts If you want to set a default gateway, you can put that in :

/etc/sysconfig/network-scripts
GATEWAY 192.168.56.254

But if you remove this line, it will take the gateway from your first interface (mostly what you want).

Desktop environment

Minimal installs do not come with a graphical desktop interface, but if you want to, MATE seems to be the one closest to debian. You use groupinstalls for that.

groupinstall
yum groupinstall “Desktop” “Desktop Platform” “X Window System” “fonts”

Watch the output for errors, because they may be called slightly different between versions. After installation run :

start
startx

centos 6.6 for rinis

I chose for the DVD, and managed quite well without ever having to mount dvd2.

  • Choose NAT, because bridged networking is probably forbidden by MAC address.
  • I have set the proxy for VirtualBox networking to thew rinis proxy, not sure if it's needed.
  • Install Workstation
  • set proxy=http://10.10.1.13:3128 in /etc/yum/.conf
  • set auto detect proxy settings in your browser
  • set ONBOOT=yes in /etc/sysconfig/network-scripts/ifcfg-eth0
  • After bootup, install guest additions, it will probably fail but give you the exact kernel to install
  • yum install kernel-devel-
  • yum install gcc make
  • run VBoxLinuxAdditions.run again.
  • reboot
  • yum install epel-release.noarch

This will get you a reasonable startup system.

Myself i would want chrome, but that is explained just above this chapter.

centos 7

I would not advise to do a netinstall, you have to type the mirror sites in by hand and try to guess which exact directory they need. It will say it fails, but no single clue about why, i bailed out after 10 tries : use the live version, it has an install to disk option !

i386 does not have a live version.. so you have to use netinst

Or dvd or something, but with netinst, before find a suitable mirror and then fill in the path upto the architecture part. So here is a working example in nl (see visit)

Hit done, and if Installation source says "Downloading metadata .." you are good, else find a typo or another mirror. Note that most 'normal' mirrors provide only x86_64 and you specifically have to go to altarch, and also not that only the last one of the major versions has data inside. If you really want centos 7.3 you will have to find an archive !!

enable network interface

Yes it starts with the network off, and you will have to enabled it after every startup. So of course you don't want that : edit the file

/etc/sysconfig/network-scripts/ifcfg-enp0s3

Any way that was what it was called in my installation, but some tabbing will show you how yours is called. It contains a number of options you might want to review. But the one we need to change is :

ONBOOT=no

Now i will list some equivalent commands in centos from debian. Most of it comes from this site

dev == devel

In naming packages, the source is mostly called xxxx-devel instead of xxxx-dev (debian)

apt-get == yum

There is no real substitute for aptitude, but apt-get and yum are very similar. You can install an rpm package with yum, where you would use dpkg in debian.

yum
yum install package.rpm

If you use aptitude mainly to search for packages, you can use the list command with yum :

search
yum list | grep http

Or just :

exact match
yum list httpd

But then an exact match should exist, so yum list http would not match.

dpkg == rpm

Same difference, it is the package manager for centos, also very similar.

update-rc.d == chkconfig

And apache == httpd :

start apache
update-rc.d apache start

Centos version :

start apache
chkconfig https on

/etc/init.d/apache2 restart == service httpd restart

BUT, this command also works on debian (albeit "service apache2 restart" of course). So better learn to start/stop services with the service command on debian as well.

install problems

Error: failure: "repodata/eb9495df6079e8f12f9988768f4ad64ce484b7213d4659cfbc7586da8d1224c5-filelists.sqlite.bz2" from updates: [Errno 256] No more mirrors to try.

This will probably help :

clean
yum clean all
yum update

redhat package manager

As it says, but of course it is also usable for CentOS.

signing

This was needed for the problem with dellomsa downloads. The method dell uses is a cgi script bootstrap.cgi

which in turn runs on the server and downloads a shell script :

script
bootstrap.sh 

Which is altered slightly to contain the server and directory to download from. The script however should also run on the local repository but it has some bugs we like to point out.

problem

The problem we encounter is this error when executing the downloaded script /tmp/bootstrap.cgi : (ansible error) :

output
Failed: [default] => {"changed": true, "cmd": "/tmp/bootstrap.sh", "delta": "0:00:07.571622", "end": "2015-09-09 11:20:20.980802", "rc": 1, "start": "2015-09-09 11:20:13.409180", "warnings": []}
stdout: Downloading GPG key: http://10.11.6.44/dellomsa_5/RPM-GPG-KEY-dell
    Key already exists in RPM, skipping
Downloading GPG key: http://10.11.6.44/dellomsa_5/RPM-GPG-KEY-libsmbios
    Key already exists in RPM, skipping
Write repository configuration
Downloading repository RPM
Repository RPM Failed GPG check! http://10.11.6.44/dellomsa_5/platform_independent/rh50_64/prereq/dell-omsa-repository-2-5.noarch.rpm

FATAL: all hosts have already failed -- aborting

The problem is indeed in the fact that the downloaded keys are skipped, and the package can't be installed because of the missing key(s).

cause

When you login to the server, you can run the script by hand to get almost the same error. Now try to list the keys that rpm uses :

list keys
rpm -qa | grep gpg

This will list something like :

output
gpg-pubkey-e8562897-459f07a4

So .. only one key, and we tested two and they are said to be installed both so there must be something wrong. The script first tests the email address of dell to later check that as a identifier against the keys, with this line :

inside script
email=$(gpg -v ${GPG_FN} 2>/dev/null  | grep 1024D | perl -p -i -e 's/.*[visit]((.*))/1/')

This would give this result with gpg installed, it list some details from the GPG key downloaded in /tmp and extracts the email address :

address
linux-security@dell.com

But as you guessed , gpg was not installed, and then it yields : Nothing.

Now in the script we loop through all installed rpm keys with :

rpm keys
1
2
3
4
5
6
7
for key in $(rpm -qa | grep gpg-pubkey)
do
    if rpm -qi $key | grep -q "^Summary.*$email"; then
        HAVE_KEY=1;
        break;
    fi
done

lvm

Centos out of the box will be installed with lvm active, but last time it just only partitioned half of my disk. Also there is no gui to handle the LVM setup. To get one install this :

lvm
yum install system-storage-manager 
ssl list

But that is still cli, if you really want a gui :

install
wget https://kojipkgs.fedoraproject.org//packages/system-config-lvm/1.1.18/1.fc19/noarch/system-config-lvm-1.1.18-1.fc19.noarch.rpm
yum install system-config-lvm-1.1.18-1.fc19.noarch.rpm

This one will appear in the control center under Administration.

stop screensaver for demo portal

This script maybe ?!?! (I leave this here since it might work on other systems)

stop screensaver
1
2
3
4
5
#!/bin/sh
export DISPLAY=:0.0
xset s off
xset s noblank
xset -dpms

NOPE !! Not working

Next attempt : Working on centos !

gsettings
1
2
3
gsettings set org.gnome.desktop.screensaver lock-delay 3600
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

This seems to get us somewhere but we have mate desktop so :

gsettings
1
2
3
4
5
6
gsettings list-schemas 

# kies org.mate.screensaver
gsettings --list-keys org.mate.screensaver
# dan zie je alle keys die er zijn
gsetting get/set om te zien/aanpassen

Actually you can see it happen : open System->preferences->look and feel->screensaver

Then do :

gsettings
gsettings set org.mate.screensaver lock-enabled false 

You will see this setting change : "Lock screen when screensaver is active".