Update your 1&1 CentOS Linux Dedicated server using yum command

How to update your 1&1 dedicated server using CentOS, using yum command to update and patch CentOS Linux. Use yum command to install critical and non-critical security updates as well as binary packages. Log in as the root user to install and update the system.

But first, you might want to get the latest Yum Repository – I found this great article at Utter Ramblings that takes you through the steps to get the latest Yum Repository.

Here is a short synopsis of the steps to get your repository up to date with latest packages. All the binaries at Utter Ramblings are GPG signed. That means that you can be sure that these packages are coming from Utter Ramblings, even if you should happen to find them on some other site (if you find a file with “JSON” in the name and it isn’t signed, DON’T install it).

In order to validate that the packages came from Utter Ramblings, you’ll want to install Utter Ramblings public GPG key on your system. You can take care of that with a single command:

rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

The preferred method of adding Utter Ramblings repository to your RHEL or CentOS system is with the Yum package manager. CentOS 4, CentOS 5, and RHEL 5 install yum automatically. If you are using RHEL 4 then you can install yum or add the following to your ‘/etc/sysconfig/rhn/sources’ file and install the sqlite package (i386 – x86_64) to use Utter Ramblings repository with ‘up2date’.

# Enable Jason's Utter Ramblings Repo
 yum utterramblings http://www.jasonlitka.com/media/EL4/$ARCH

For those of you using yum, type:

nano -w /etc/yum.repos.d/utterramblings.repo

… and then paste the following into the editor:

[utterramblings]
 name=Jason's Utter Ramblings Repo
 baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
 enabled=1
 gpgcheck=1
 gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

NOTE: If the above URL returns a 404 then try hard-coding $releasever to your EL version (‘EL4’ or ‘EL5’) and the $basearch to whatever is appropriate (‘i386’ or ‘x86_64).

Once you’ve taken care of the above, you’ll be able to easily upgrade with a simple ‘up2date -u’ or ‘yum update’.

There is one caveat to the above statement… If your 64-bit system includes both 32-bit and 64-bit packages by the same name (such as “mysql.i386” and “mysql.x86_64” ) then you will experience a problem unless you remove the 32-bit packages from your system.

Utter Ramblings suggest that you would not simply download a single file to your server and install it. The packages that are in these folders are, in many cases, dependent on each other and will not work on a stock system.

Here is a set of Yum commands that are useful.

Task: Display list of updated software (security fix)

Type the following command at shell prompt:

# yum list updates

Task: Patch up system by applying all updates

To download and install all updates type the following command:

# yum update

Task: List all installed packages

List all installed packages, enter:

# rpm -qa

# yum list installed

Find out if httpd package installed or not, enter:

# rpm -qa | grep httpd*

# yum list installed httpd

Task: Check for and update specified packages

# yum update {package-name-1}

To check for and update httpd package, enter:

# yum update httpd

Task: Search for packages by name

Search httpd and all matching perl packages, enter:

# yum list {package-name}

# yum list {regex}

# yum list httpd

# yum list perl*

Sample output:

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Installed Packages

php.x86_64 5.2.11-jason.1 installed

php-cli.x86_64  5.2.11-jason.1 installed

php-common.x86_64 5.2.11-jason.1 installed

php-gd.x86_64                          5.2.11-jason.1             installed

php-imap.x86_64                        5.2.11-jason.1             installed

php-mbstring.x86_64                    5.2.11-jason.1             installed

php-mysql.x86_64                       5.2.11-jason.1             installed

php-pdo.x86_64                         5.2.11-jason.1             installed

php-xml.x86_64                         5.2.11-jason.1             installed

Available Packages

php-apc.x86_64                         3.0.19-1.jason.1           utterramblings

php-bcmath.x86_64                      5.2.11-jason.1             utterramblings

php-dba.x86_64                         5.2.11-jason.1             utterramblings

php-dbase.x86_64                       5.1.6-15.el5.centos.1      extras

php-devel.x86_64                       5.2.11-jason.1             utterramblings

php-eaccelerator.x86_64                1:0.9.5.3-jason.1          utterramblings

php-embedded.x86_64                    5.2.11-jason.1             utterramblings

php-ldap.x86_64                        5.2.11-jason.1             utterramblings

php-mcrypt.x86_64                      5.2.11-jason.1             utterramblings

php-memcache.x86_64                    3.0.4-1.jason.1            utterramblings

php-mhash.x86_64                       5.2.11-jason.1             utterramblings

php-mssql.x86_64                       5.2.11-jason.1             utterramblings

php-ncurses.x86_64                     5.2.11-jason.1             utterramblings

php-odbc.x86_64                        5.2.11-jason.1             utterramblings

php-pear.noarch                        1:1.7.2-2.jason.1          utterramblings

php-pear-Auth-SASL.noarch              1.0.2-4.el5.centos         extras

php-pear-DB.noarch                     1.7.13-1.el5.centos        extras

php-pear-Date.noarch                   1.4.7-2.el5.centos         extras

php-pear-File.noarch                   1.2.2-1.el5.centos         extras

php-pear-HTTP-Request.noarch           1.4.2-1.el5.centos         extras

php-pear-Log.noarch                    1.9.13-1.el5.centos        extras

php-pear-MDB2.noarch                   2.4.1-2.el5.centos         extras

php-pear-MDB2-Driver-mysql.noarch      1.4.1-3.el5.centos         extras

php-pear-Mail.noarch                   1.1.14-1.el5.centos        extras

php-pear-Mail-Mime.noarch              1.4.0-1.el5.centos         extras

…..

…….

..

Task: Install the specified packages [ RPM(s) ]

Install package called httpd:

# yum install {package-name-1} {package-name-2}

# yum install httpd

Task: Remove / Uninstall the specified packages [ RPM(s) ]

Remove package called httpd, enter:

# yum remove {package-name-1} {package-name-2}

# yum remove httpd

Task: Display the list of available packages

# yum list all

Task: Display list of group software

Type the following command:

# yum grouplist

Output:

Loaded plugins: fastestmirror

Setting up Group Process

Loading mirror speeds from cached hostfile

Installed Groups:

  • DNS Name Server
  • Legacy Network Server
  • Legacy Software Development
  • Legacy Software Support
  •     Mail Server
  •     MySQL Database
  •     PostgreSQL Database
  •     System Tools
  •     Text-based Internet
  •     Web Server
  •     Yum Utilities

Available Groups:

Administration Tools

Authoring and Publishing

Base

Beagle

Cluster Storage

Clustering

Development Libraries

Development Tools

Dialup Networking Support

Editors

Emacs

Engineering and Scientific

FTP Server

FreeNX and NX

GNOME Desktop Environment

GNOME Software Development

Games and Entertainment

Graphical Internet

Graphics

Horde

Java

Java Development

KDE (K Desktop Environment)

KDE Software Development

KVM

Mono

Network Servers

News Server

Office/Productivity

OpenFabrics Enterprise Distribution

Printing Support

Ruby

Server Configuration Tools

Sound and Video

Tomboy

Virtualization

Windows File Server

X Software Development

X Window System

XFCE-4.4

Done

Task: Install all the default packages by group

Install all ‘Development Tools’ group packages, enter:

# yum groupinstall “Development Tools”

Task: Update all the default packages by group

Update all ‘Development Tools’ group packages, enter:

# yum groupupdate “Development Tools”

Task: Remove all packages in a group

Remove all ‘Development Tools’ group packages, enter:

# yum groupremove “Development Tools”

Task: Install particular architecture package

If you are using 64 bit RHEL version it is possible to install 32 packages:

# yum install {package-name}.{architecture}

# yum install mysql.i386

Task: Display packages not installed via official RHN subscribed repos

Show all packages not available via subscribed channels or repositories i.e show packages installed via other repos:

# yum list extras

Sample output:

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Extra Packages

SSHTerm.noarch                        0.2.2-9.278624                   installed

audit-libs.x86_64                     1.7.7-6.el5_3.3                  installed

audit-libs-python.x86_64              1.7.7-6.el5_3.3                  installed

authconfig.x86_64                     5.3.21-5.el5                     installed

awstats.noarch                        6.6-1.swsoft                     installed

bind.x86_64                           30:9.3.4-10.P1.el5_3.3           installed

bind-libs.x86_64                      30:9.3.4-10.P1.el5_3.3           installed

bind-utils.x86_64                     30:9.3.4-10.P1.el5_3.3           installed

centos-release.x86_64                 10:5-3.el5.centos.1              installed

centos-release-notes.x86_64           5.3-3                            installed

coreutils.x86_64                      5.97-19.el5                      installed

courier-imap.x86_64                   3.0.8-cos5.build92091016.19      installed

cpio.x86_64                           2.6-20                           installed

cpuspeed.x86_64                       1:1.2.1-5.el5                    installed

cryptsetup-luks.x86_64                1.0.3-4.el5                      installed

device-mapper.i386                    1.02.28-2.el5                    installed

device-mapper.x86_64                  1.02.28-2.el5                    installed

device-mapper-event.x86_64            1.02.28-2.el5                    installed

device-mapper-multipath.x86_64        0.4.7-23.el5_3.4                 installed

dhclient.x86_64                       12:3.0.5-18.el5                  installed

dhcpv6-client.x86_64                  1.0.10-16.el5                    installed

dmidecode.x86_64                      1:2.7-1.28.2.el5                 installed

dmraid.x86_64                         1.0.0.rc13-33.el5                installed

e2fsprogs.x86_64                      1.39-20.el5                      installed

e2fsprogs-libs.i386                   1.39-20.el5                      installed

e2fsprogs-libs.x86_64                 1.39-20.el5                      installed

ethtool.x86_64                        6-2.el5                          installed

findutils.x86_64                      1:4.2.27-5.el5                   installed

fipscheck.x86_64                      1.0.3-1.el5                      installed

grep.x86_64                           2.5.1-54.2.el5                   installed

grub.x86_64                           0.97-13.2                        installed

hal.x86_64                            0.5.8.1-38.el5                   installed

httpd.x86_64                          2.2.3-22.el5.centos.2            installed

hwdata.noarch                         0.213.11-1.el5                   installed

initscripts.x86_64                    8.45.25-1.el5.centos             installed

iproute.x86_64                        2.6.18-9.el5                     installed

iptables.x86_64                       1.3.5-4.el5                      installed

iptables-ipv6.x86_64                  1.3.5-4.el5                      installed

iputils.x86_64                        20020927-45.el5                  installed

kernel.x86_64                         2.6.26.8rootserver20081113a-1    installed

Task: Display what package provides the file

You can easily find out what RPM package provides the file. For example find out what provides the /etc/passwd file:

# yum whatprovides /etc/passwd

Sample output:

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

setup-2.5.58-7.el5.noarch : A set of system configuration and setup files.

Matched from:

Filename    : /etc/passwd

setup-2.5.58-4.el5.noarch : A set of system configuration and setup files.

Matched from:

Other       : Provides-match: /etc/passwd

You can use the same command to list packages that satisfy dependencies:

# yum whatprovides {dependency-1} {dependency-2}

Refer yum command man page for more information:

# man yum

Finally, when you update httpd, php, mysql do not forget to restart the service.

#  service httpd restart

# service mysqld restart


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *