서버 운영 관리 [ Tip ]

차동훈 에반젤리스트

Linux 구성 요소 추가 설치 ( yum, apt-get )

 

리눅스를 서버로 활용하기 위해 서버 관리자가 원하는 패키지를 설치, 설정하고 구동해야 하는것은 당연한 말이다.

하지만 초보 관리자가 서버에 원하는 패키지를 설치 하기에는 설치 방법이나 호환 여부 및 의존성 체크 등 여러가지

확인해야할 사항이 존재해 어렵기만한데, 리눅스에서는 yum 이나 apt-get 이라는 패키지 관리 툴을 이용하여

보다 쉽게 패키지를 설치하고 삭제할 수 있게 도와준다.

 

Linux 구성 요소 추가 설치 방법에서 yum ( redhat 계열 ) ,  apt-get ( debian 계열 ) 의 대한 설명이다.

yum=[Centos], apt-get=[ubuntu] 에서 진행 하였다.

 

Linux 구성요소 추가 설치 


 

 

 1. CentOS 구성요소 추가 설치

패키지 리스트 확인

  • yum list

[root@localhost ~]# yum list
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: ftp.daumkakao.com
* updates: ftp.daumkakao.com
Installed Packages
ModemManager-glib.x86_64 1.1.0-8.git20130913.el7 @base
NetworkManager.x86_64 1:1.0.6-30.el7_2 @updates
NetworkManager-adsl.x86_64 1:1.0.6-30.el7_2 @updates
NetworkManager-bluetooth.x86_64 1:1.0.6-30.el7_2 @updates
NetworkManager-glib.x86_64 1:1.0.6-30.el7_2 @updates

========================================================================

  • yum grouplist

[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: ftp.daumkakao.com
* updates: ftp.daumkakao.com
Available Environment Groups:

 

패키지 설치

  • yum install [패키지명] 을 사용 한다.

[root@localhost ~]# yum install gcc-gnat
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: ftp.daumkakao.com
* updates: ftp.daumkakao.com
Resolving Dependencies
--> Running transaction check
---> Package gcc-gnat.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: libgnat-devel = 4.8.5-4.el7 for package: gcc-gnat-4.8.5-4.el7.x86_64
--> Processing Dependency: libgnat = 4.8.5-4.el7 for package: gcc-gnat-4.8.5-4.el7.x86_64
--> Running transaction check
---> Package libgnat.x86_64 0:4.8.5-4.el7 will be installed
---> Package libgnat-devel.x86_64 0:4.8.5-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================

  • yum groupinstall "그룹 패키지 명"

[root@localhost ~]# yum groupinstall "KDE Plasma Workspaces"
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: ftp.daumkakao.com
* extras: ftp.daumkakao.com
* updates: ftp.daumkakao.com

 

 

2. CentOS 구성요소 제거

삭제 할 패키지 확인

  • 대상 패키지의 전체 이름을 확인 한다.
  • rpm -qa |grep [ 패키지명 ]

[root@localhost ~]# rpm -qa |grep openssl
openssl-libs-1.0.1e-51.el7_2.5.x86_64
openssl-1.0.1e-51.el7_2.5.x86_64

 

패키지 삭제

  • yum remove [패키지명]

[root@localhost ~]# yum remove openssl-1.0.1e-51.el7_2.5.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 1:1.0.1e-51.el7_2.5 will be erased

 

의존성 무시 삭제

 

  • rpm -e --nodeps [패키지명]

[root@localhost ~]# rpm -e --nodeps openssl-1.0.1e-51.el7_2.5.x86_64

 

 

 

3. Ubuntu 구성요소 추가 설치

패키지 리스트 확인 

  • Ubuntu의 경우 관리자 권한이 아닌경우 명령어 앞에 sudo를 붙여 권한을 취득해야 한다.

root@smileserv:~# apt-cache pkgnames 

account-plugin-yahoojp
ceph-fuse
dvd+rw-tools
e3
gnome-commander-data
grub-gfxpayload-lists
gweled
libannotation-indexer-java-doc
libboost-timer-dev
libdune-istl-dev
libfile-keepass-perl
libghc-configfile-dev
libgnome-desktop-3-dev
libphat-dev
libsimple-http-java-doc
libsslcommon2-dev
libtag1-dev....( 중략 )

 

패키지 설치

  • apt-get install [패키지명]

root@smileserv:~# apt-get install lcl-qt4
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료

 

 

4. Ubuntu 구성요소 삭제

삭제 할 패키지 확인

  • dpkg --list |grep [패키지명]

root@smileserv:~# dpkg --list |grep openssl
ii libgnutls-openssl27:amd64 2.12.23-12ubuntu2.1 amd64 GNU TLS library - OpenSSL wrapper
ii openssl 1.0.1f-1ubuntu2.18 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii python-openssl 0.13-2ubuntu6 amd64 Python 2 wrapper around the OpenSSL library

 

 

패키지 삭제

  • apt-get remove [패키지명]

root@smileserv:~# apt-get remove python-openssl