A CentOS csomagkezelője a yum, ezt kell használnunk, ha telepíteni, törölni vagy frissíteni szeretnénk a szerverünket.
Frissítés
A frissítés célja általában egy hibamentesebb vagy biztonságosabb állapot elérése, mivel a szoftverekben mindig találnak valami működésbeli vagy biztonságbeli hibát. Az első esetben akkor célszerű frissítenünk, ha valami nem működik jól, és az újabb csomagban ezt javították, a második esetben pedig akkor, ha a biztonsági hiba okán veszélyben érezzük magunkat. Általánosságban célszerű időnként ellenőrizni, hogy van-e valamiből újabb csomag, és általában meg is ejthetjük a frissítést:
Frissítések keresése
# yum check-update
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: tux.rainside.sk
* extras: tux.rainside.sk
* rpmforge: repository.vsb.cz
* updates: tux.rainside.sk
lldpad.x86_64 0.9.43-13.el6_2.1 updates
Frissítés
# yum update
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: tux.rainside.sk
* extras: tux.rainside.sk
* rpmforge: nl.mirror.eurid.eu
* updates: tux.rainside.sk
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package lldpad.x86_64 0:0.9.43-13.el6_2 will be updated
---> Package lldpad.x86_64 0:0.9.43-13.el6_2.1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Updating:
lldpad x86_64 0.9.43-13.el6_2.1 updates 192 k
Transaction Summary
=====================================================================================================================================================================================================
Upgrade 1 Package(s)
Total download size: 192 k
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta | 399 kB 00:00
Processing delta metadata
Download delta size: 161 k
lldpad-0.9.43-13.el6_2_0.9.43-13.el6_2.1.x86_64.drpm | 161 kB 00:00
Finishing rebuild of rpms, from deltarpms
<delta rebuild> | 192 kB 00:01
Presto reduced the update size by 16% (from 192 k to 161 k).
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : lldpad-0.9.43-13.el6_2.1.x86_64 1/2
Cleanup : lldpad-0.9.43-13.el6_2.x86_64 2/2
Updated:
lldpad.x86_64 0:0.9.43-13.el6_2.1
Complete!
Ennyi volna… 🙂
Telepítés
A telepítés se sokkal összetettebb, egyszerűen csak meg kell keresnünk, amit telepítenénk, majd fel kell telepítenünk…
Csomag keresése
# yum search httpd
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: tux.rainside.sk
* extras: tux.rainside.sk
* rpmforge: www.mirrorservice.org
* updates: tux.rainside.sk
======================================================================================== N/S Matched: httpd =========================================================================================
lighttpd-fastcgi.x86_64 : FastCGI module and spawning helper for lighttpd and PHP configuration
lighttpd-mod_mysql_vhost.x86_64 : Virtual host module for lighttpd that uses a MySQL database
httpd.x86_64 : Apache HTTP Server
httpd-devel.i686 : Development interfaces for the Apache HTTP server
httpd-devel.x86_64 : Development interfaces for the Apache HTTP server
httpd-manual.noarch : Documentation for the Apache HTTP server
httpd-tools.x86_64 : Tools for use with the Apache HTTP Server
lighttpd.x86_64 : Lightning fast webserver with light system requirements
mergelog.x86_64 : Merges httpd log files by date
mod_dav_svn.x86_64 : Apache httpd module for Subversion server
mod_dnssd.x86_64 : An Apache HTTPD module which adds Zeroconf support
perl-Apache-ConfigFile.noarch : Parse an Apache style httpd.conf configuration file
perl-Apache-SizeLimit.noarch : Module to kill off Apache httpd processes if they grow too large.
perl-Log-Common.noarch : Log messages in the httpd access and error log styles
Name and summary matches only, use "search all" for everything.
Telepítés
# yum install httpd.x86_64 httpd-tools.x86_64
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: tux.rainside.sk
* extras: tux.rainside.sk
* rpmforge: mirror.nl.leaseweb.net
* updates: tux.rainside.sk
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-15.el6.centos.1 will be installed
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-15.el6.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-15.el6.centos.1.x86_64
---> Package httpd-tools.x86_64 0:2.2.15-15.el6.centos.1 will be installed
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-3.el6_1.2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
httpd x86_64 2.2.15-15.el6.centos.1 updates 813 k
httpd-tools x86_64 2.2.15-15.el6.centos.1 updates 70 k
Installing for dependencies:
apr x86_64 1.3.9-3.el6_1.2 base 123 k
apr-util x86_64 1.3.9-3.el6_0.1 base 87 k
apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k
mailcap noarch 2.1.31-2.el6 base 27 k
Transaction Summary
=====================================================================================================================================================================================================
Install 6 Package(s)
Total download size: 1.1 M
Installed size: 3.6 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 1.1 M
(1/6): apr-1.3.9-3.el6_1.2.x86_64.rpm | 123 kB 00:00
(2/6): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00
(3/6): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00
(4/6): httpd-2.2.15-15.el6.centos.1.x86_64.rpm | 813 kB 00:00
(5/6): httpd-tools-2.2.15-15.el6.centos.1.x86_64.rpm | 70 kB 00:00
(6/6): mailcap-2.1.31-2.el6.noarch.rpm | 27 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.2 MB/s | 1.1 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : apr-1.3.9-3.el6_1.2.x86_64 1/6
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 2/6
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 3/6
Installing : httpd-tools-2.2.15-15.el6.centos.1.x86_64 4/6
Installing : mailcap-2.1.31-2.el6.noarch 5/6
Installing : httpd-2.2.15-15.el6.centos.1.x86_64 6/6
Installed:
httpd.x86_64 0:2.2.15-15.el6.centos.1 httpd-tools.x86_64 0:2.2.15-15.el6.centos.1
Dependency Installed:
apr.x86_64 0:1.3.9-3.el6_1.2 apr-util.x86_64 0:1.3.9-3.el6_0.1 apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 mailcap.noarch 0:2.1.31-2.el6
Complete!
Ellenőrzés
Mindig ellenőrizzük le, hogy valóban azt telepítettük, amit szerettünk volna, jelen esetben ez a csomag az Apache Httpd szerver:
# /etc/init.d/httpd status
httpd is stopped
# /etc/init.d/httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 0.0.10.59 for ServerName
[ OK ]
Mivel a tűzfal aktív, így egyelőre nem tudunk hozzáférni az http porthoz… a tűzfalról majd később… 🙂