yum 명령어 사용 팁은 무엇인가요?
💡 요약 정리
- yum은 리눅스에서 패키지를 분석하고 설치·제거·업데이트하는 데 사용하는 관리 도구입니다.
yum search,yum list available,yum info명령으로 패키지를 쉽게 찾고 확인할 수 있습니다.yum install,yum remove를 사용하면 의존성까지 자동으로 처리됩니다.- 시스템 전체를 최신으로 유지하려 면
yum update,yum check-update를 주기적으로 실행하세요.
1. yum search application_name
- 사용 가능한
application_name(예: mysql, httpd 등) 관련 패키지를 검색합니다. - 예를 들어, 아래 명령어를 실행하면 'mysql'과 관련된 모든 패키지를 보여줍니다.
[root@localhost ~]# yum search mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
========================================================== Matched: mysql ==========================================================
mod_auth_mysql.x86_64 : Basic authentication for the Apache web server using a MySQL database.
qt-MySQL.x86_64 : MySQL drivers for Qt's SQL classes.
MySQL-python.x86_64 : An interface to MySQL
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
bytefx-data-mysql.x86_64 : MySQL database connectivity for Mono
freeradius-mysql.x86_64 : MySQL bindings for freeradius
freeradius2-mysql.x86_64 : MySQL support for freeradius
libdbi-dbd-mysql.x86_64 : MySQL plugin for libdbi
mysql.x86_64 : MySQL client programs and shared libraries
mysql.i386 : MySQL client programs and shared libraries
mysql-bench.x86_64 : MySQL benchmark scripts and data
mysql-connector-odbc.x86_64 : ODBC driver for MySQL
mysql-connector-odbc64.x86_64 : ODBC driver for MySQL
mysql-devel.i386 : Files for development of MySQL applications
mysql-devel.x86_64 : Files for development of MySQL applications
mysql-server.x86_64 : The MySQL server and related files
mysql-test.x86_64 : The test suite distributed with MySQL
pdns-backend-mysql.x86_64 : MySQL backend for pdns
perl-DBD-MySQL.x86_64 : A MySQL interface for perl
php-mysql.x86_64 : A module for PHP applications that use MySQL databases.
php-pdo.x86_64 : A database access abstraction module for PHP applications
php-pear-MDB2-Driver-mysql.noarch : MySQL MDB2 driver
php53-mysql.x86_64 : A module for PHP applications that use MySQL databases
php53-pdo.x86_64 : A database access abstraction module for PHP applications
qt4-mysql.x86_64 : MySQL drivers for Qt's SQL classes
rsyslog.x86_64 : Enhanced system logging and kernel message trapping daemon
rsyslog-mysql.x86_64 : MySQL support for rsyslog
rsyslog5.x86_64 : Enhanced system logging and kernel message trapping daemon
rsyslog5-mysql.x86_64 : MySQL support for rsyslog
unixODBC.i386 : A complete ODBC driver manager for Linux
unixODBC.x86_64 : A complete ODBC driver manager for Linux
unixODBC64.x86_64 : A complete ODBC driver manager for Linux
[root@localhost ~]#
2. yum list available
- 사용 가능한 전체 패키지 리스트를 확인할 수 있습니다.
- 아래 명령어를 사용하면 설치 가능한 모든 패키지를 페이지별로(또는 grep을 통해) 검색할 수 있습니다.
[root@localhost ~]# yum list available | more
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
Available Packages
Cluster_Administration-as-IN.noarch 5.8-1.el5.centos base
Cluster_Administration-bn-IN.noarch 5.8-1.el5.centos base
Cluster_Administration-de-DE.noarch 5.8-1.el5.centos base
Cluster_Administration-en-US.noarch 5.8-1.el5.centos base
Cluster_Administration-es-ES.noarch 5.8-1.el5.centos base
Cluster_Administration-fr-FR.noarch 5.8-1.el5.centos base
Cluster_Administration-gu-IN.noarch 5.8-1.el5.centos base
Cluster_Administration-hi-IN.noarch 5.8-1.el5.centos base
...
3. yum info application_name
- 특정 패키지의 상세 정보를 확인할 수 있습니다.
- 아래 명령어를 예로 들면
tomcat5.x86_64패키지의 정보입니다.
[root@localhost ~]# yum info tomcat5.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
Available Packages
Name : tomcat5
Arch : x86_64
Version : 5.5.23
Release : 0jpp.37.el5
Size : 394 k
Repo : base
Summary : Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
URL : http://tomcat.apache.org/
License : Apache Software License
Description: Tomcat is the servlet container that is used in the official Reference
Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by
Sun under the Java Community Process.
Tomcat is developed in an open and participatory environment and
released under the Apache Software License. Tomcat is intended to be
a collaboration of the best-of-breed developers from around the world.
We invite you to participate in this open development project. To
learn more about getting involved, click here.
[root@localhost ~]#
4. yum list extras
- 현재 서버의 yum 레포지터리 기준으로, 업그레이드 가능한 패키지와 업그레이드가 불가능한 패키지를 구분해 보여줍니다.
[root@localhost ~]# yum list extras
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
Extra Packages
OpenIPMI.x86_64 2.0.16-13.el5_8 installed
OpenIPMI-libs.x86_64 2.0.16-13.el5_8 installed
aspell-en.x86_64 50:6.0-2.1 installed
autofs.x86_64 1:5.0.1-0.rc2.164.el5_8 installed
centos-release.x86_64 10:5-8.el5.centos installed
centos-release-notes.x86_64 5.8-0 installed
...
5. yum install application_name
- 지정한 패키지를 설치합니다.
- 의존성 있는 패키지도 함께 자동으로 설치됩니다.
[root@localhost ~]# yum install application_name
6. yum remove application_name
- 패키지를 삭제합니다.
- 해당 패키지에 의존하고 있는 다른 종속 패키지도 함께 삭제할 수 있습니다.
[root@localhost ~]# yum remove application_name
7. yum update
- 시스템 전체를 업데이트합니다.
- 업데이트 가능한 모든 패키지를 한 번에 설치합니다.
[root@localhost ~]# yum update
8. yum check-update
- 업데이트 가능한 패키지가 있는지 확인할 수 있습니다.
- 실제 설치 전 확인용으로 주로 사용됩 니다.
[root@localhost ~]# yum check-update