윈도우에서 프로그램 설치
* msi
* 설치파일
* 압축방식 - zip / 7z
리눅스 내부에서 프로그램 설치
* c / c++ 소스 - 컴파일 - 설치(오픈소스이기 때문에 가능/직접수정가능)
* 실행파일을 압축 - gzip
이클립스
* 패키지 설치 관리자
레드햇 rpm(Redhat Package Management) - update - yum
- rpm을 보관하고 있는 원격 저장소
rpm - 의존성 검사(Dependancy Test)
데비안 Mac계열
리눅스
수세
...
소프트웨어 관리하기
RPM 패키지 설치
rpmfind.net이라는 사이트는 rpm을 관리하는 사이트인데 여기서 filezilla를 검색해보면 위 RPM 패키지 이름 구성법대로 작성되있음을 확인할 수 있다
[master@localhost ~]$ rpm --version
RPM 버전 - 4.11.3
[master@localhost CentOS 7 x86_64]$ pwd
/run/media/master/CentOS 7 x86_64
[master@localhost CentOS 7 x86_64]$ ls
CentOS_BuildTag GPL RPM-GPG-KEY-CentOS-7 images
EFI LiveOS RPM-GPG-KEY-CentOS-Testing-7 isolinux
EULA Packages TRANS.TBL repodata
[master@localhost CentOS 7 x86_64]$ ls
[master@localhost CentOS 7 x86_64]$ ls
[master@localhost CentOS 7 x86_64]$ ls
CentOS_BuildTag GPL RPM-GPG-KEY-CentOS-7 images
EFI LiveOS RPM-GPG-KEY-CentOS-Testing-7 isolinux
EULA Packages TRANS.TBL repodata
CD를 connect후 pwd와 ls, umount후 ls를 확인하면 디렉터리가 있다가 없음을 확인할 수 있다
[master@localhost CentOS 7 x86_64]$ cd ../
[master@localhost master]$ cd CentOS\ 7\ x86_64/Packages/
[master@localhost Packages]$ ls -al | more
합계 3782287
drwxrwxr-x. 2 master master 655360 5월 4 05:52 .
drwxr-xr-x. 8 master master 2048 5월 4 05:54 ..
-rw-rw-r--. 1 master master 1794136 4월 25 19:52 389-ds-base-1.3.7.5-18.el7.x86_64.rp
m
-rw-rw-r--. 1 master master 711232 4월 25 19:52 389-ds-base-libs-1.3.7.5-18.el7.x86_
64.rpm
-rw-rw-r--. 1 master master 36116 7월 4 2014 ElectricFence-2.2.2-39.el7.x86_64.rp
m
-rw-rw-r--. 1 master master 1047864 7월 4 2014 GConf2-3.2.6-8.el7.x86_64.rpm
-rw-rw-r--. 1 master master 1101952 11월 21 2016 GeoIP-1.5.0-11.el7.x86_64.rpm
-rw-rw-r--. 1 master master 2226028 6월 17 2016 ImageMagick-6.7.8.9-15.el7_2.x86_64.
rpm
-rw-rw-r--. 1 master master 148960 6월 17 2016 ImageMagick-c++-6.7.8.9-15.el7_2.x86
_64.rpm
-rw-rw-r--. 1 master master 150992 6월 17 2016 ImageMagick-perl-6.7.8.9-15.el7_2.x8
6_64.rpm
-rw-rw-r--. 1 master master 255992 7월 4 2014 LibRaw-0.14.8-5.el7.20120830git98d92
5.x86_64.rpm
-rw-rw-r--. 1 master master 752928 4월 25 20:27 ModemManager-1.6.10-1.el7.x86_64.rpm
-rw-rw-r--. 1 master master 237044 4월 25 20:27 ModemManager-glib-1.6.10-1.el7.x86_6
4.rpm
-rw-rw-r--. 1 master master 91880 11월 21 2016 MySQL-python-1.2.5-1.el7.x86_64.rpm
-rw-rw-r--. 1 master master 1831256 4월 25 20:29 NetworkManager-1.10.2-13.el7.x86_64.
rpm
[master@localhost Packages]$ ls -l xterm-295-3.el7.x86_64.rpm
-rw-rw-r--. 1 master master 466100 7월 4 2014 xterm-295-3.el7.x86_64.rpm
[master@localhost Packages]$ rpm -ivh xterm-295-3.el7.x86_64.rpm
오류: Failed dependencies:
libXaw.so.7()(64bit) is needed by xterm-295-3.el7.x86_64
[master@localhost Packages]$ ls libXaw*
libXaw-1.0.13-4.el7.x86_64.rpm libXaw-devel-1.0.13-4.el7.x86_64.rpm
[master@localhost Packages]$ rpm -ivh libXaw-devel-1.0.13-4.el7.x86_64.rpm
오류: Failed dependencies:
libXaw = 1.0.13-4.el7 is needed by libXaw-devel-1.0.13-4.el7.x86_64
libXaw.so.7()(64bit) is needed by libXaw-devel-1.0.13-4.el7.x86_64
pkgconfig(xext) is needed by libXaw-devel-1.0.13-4.el7.x86_64
pkgconfig(xmu) is needed by libXaw-devel-1.0.13-4.el7.x86_64
pkgconfig(xpm) is needed by libXaw-devel-1.0.13-4.el7.x86_64
pkgconfig(xt) is needed by libXaw-devel-1.0.13-4.el7.x86_64
[master@localhost Packages]$ ls -l pkgcon*
-rw-rw-r--. 1 master master 54928 7월 4 2014 pkgconfig-0.27.1-4.el7.x86_64.rpm
[master@localhost Packages]$ rpm -ivh pkgconfig-0.27.1-4.el7.x86_64.rpm
오류: can't create transaction lock on /var/lib/rpm/.rpm.lock (허가 거부)
master로 설치하려고 해서 오류가 나고 있었음. root로 접근해서 재시도
[master@localhost Packages]$ su - root
암호:
마지막 로그인: 목 8월 16 13:14:56 KST 2018 일시 pts/1
[root@localhost ~]# cd /run/media/master/CentOS\ 7\ x86_64/Packages/
[root@localhost Packages]# pwd
/run/media/master/CentOS 7 x86_64/Packages
[root@localhost Packages]# rpm -ivh pkgconfig-0.27.1-4.el7.x86_64.rpm
준비 중... ################################# [100%]
pkgconfig-1:0.27.1-4.el7.x86_64 패키지는 이미 설치되어 있습니다
[root@localhost Packages]# ls libXaw*
libXaw-1.0.13-4.el7.x86_64.rpm libXaw-devel-1.0.13-4.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh libXext-1.3.3-3.el7.x86_64.rpm
준비 중... ################################# [100%]
libXext-1.3.3-3.el7.x86_64 패키지는 이미 설치되어 있습니다
[root@localhost Packages]# rpm -ivh libXext-devel-1.3.3-3.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXext-devel-1.3.3-3.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libXpm-devel-3.5.12-1.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXpm-devel-3.5.12-1.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libICE-devel-1.0.9-9.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libICE-devel-1.0.9-9.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libSM-devel-1.2.2-2.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libSM-devel-1.2.2-2.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libXt-devel-1.1.5-3.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXt-devel-1.1.5-3.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libXmu-devel-1.1.2-2.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXmu-devel-1.1.2-2.el7 ################################# [100%]
위에거 까지가 리눅스 Gnome 개발자용 버전을 설치하면 알아서 다 설치되 있는것들인데 나는 그러질 않고 깔아서 일일이 다 설치해줘야 했다.
[root@localhost Packages]# rpm -ivh libXaw-1.0.13-4.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXaw-1.0.13-4.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh libXaw-devel-1.0.13-4.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:libXaw-devel-1.0.13-4.el7 ################################# [100%]
[root@localhost Packages]# rpm -ivh xterm-295-3.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:xterm-295-3.el7 ################################# [100%]
[root@localhost Packages]# xterm &
[1] 5204
[root@localhost Packages]# xterm: cannot load font '-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1'
[root@localhost Packages]# cd
[root@localhost ~]# ls
HelloWorld.class initial-setup-ks.cfg 공개 바탕화면 서식
HelloWorld.java sub1 다운로드 비디오 음악
anaconda-ks.cfg test.txt 문서 사진
[root@localhost ~]# ls /root/
HelloWorld.class initial-setup-ks.cfg 공개 바탕화면 서식
HelloWorld.java sub1 다운로드 비디오 음악
anaconda-ks.cfg test.txt
패키지 강제 설치하기
[root@localhost Packages]# rpm -ivh xterm-295-3.el7.x86_64.rpm
준비 중... ################################# [100%]
xterm-295-3.el7.x86_64 패키지는 이미 설치되어 있습니다
[root@localhost Packages]# rpm -ivh --replacepkgs xterm-295-3.el7.x86_64.rpm
준비 중... ################################# [100%]
Updating / installing...
1:xterm-295-3.el7 ################################# [100%]
패키지 정보 검색하기 - q
[root@localhost ~]# rpm -qa
festival-speechtools-libs-1.2.96-28.el7.x86_64
libvirt-daemon-driver-nodedev-3.9.0-14.el7_5.6.x86_64
libverto-tevent-0.2.5-4.el7.x86_64
plymouth-system-theme-0.8.9-0.31.20140113.el7.centos.x86_64
gperftools-libs-2.6.1-1.el7.x86_64
mobile-broadband-provider-info-1.20170310-1.el7.noarch
glusterfs-api-3.8.4-53.el7.centos.x86_64
libvirt-daemon-driver-network-3.9.0-14.el7_5.6.x86_64
python-deltarpm-3.6-3.el7.x86_64
spice-vdagent-0.14.0-15.el7.x86_64
cracklib-dicts-2.9.0-11.el7.x86_64
cups-filesystem-1.6.3-35.el7.noarch
compat-db-headers-4.7.25-28.el7.noarch
grub2-pc-2.02-0.65.el7.centos.2.x86_64
vdo-6.1.0.168-18.x86_64
xorg-x11-fonts-Type1-7.5-9.el7.noarch
libavc1394-0.5.3-14.el7.x86_64
libreport-gtk-2.1.11-40.el7.centos.x86_64
filesystem-3.2-25.el7.x86_64
lvm2-libs-2.02.177-4.el7.x86_64
libreswan-3.23-5.el7_5.x86_64
.
.
.
[root@localhost ~]# rpm -qa | grep xterm
xterm-295-3.el7.x86_64
[root@localhost ~]# rpm -qa > rpmlist.txt
[root@localhost ~]# vi rpmlist.txt
[root@localhost ~]# rpm -ql coreutils
/etc/DIR_COLORS
/etc/DIR_COLORS.256color
/etc/DIR_COLORS.lightbgcolor
/etc/profile.d/colorls.csh
/etc/profile.d/colorls.sh
/usr/bin/[
/usr/bin/arch
/usr/bin/base64
/usr/bin/basename
/usr/bin/cat
/usr/bin/chcon
/usr/bin/chgrp
/usr/bin/chmod
/usr/bin/chown
/usr/bin/cksum
/usr/bin/comm
/usr/bin/cp
/usr/bin/csplit
/usr/bin/cut
/usr/bin/date
/usr/bin/dd
/usr/bin/df
/usr/bin/dir
/usr/bin/dircolors
/usr/bin/dirname
/usr/bin/du
/usr/bin/echo
/usr/bin/env
/usr/bin/expand
/usr/bin/expr
/usr/bin/factor
/usr/bin/false
/usr/bin/fmt
/usr/bin/fold
/usr/bin/groups
/usr/bin/head
/usr/bin/hostid
/usr/bin/id
/usr/bin/install
/usr/bin/join
.
.
.
[root@localhost ~]# whereis ls
ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz
[root@localhost ~]# rpm -qf /usr/bin/l
Display all 110 possibilities? (y or n)
[root@localhost ~]# rpm -qf /usr/bin/ls
coreutils-8.22-21.el7.x86_64
[root@localhost ~]# rpm -ql coreutils
위 세 명령어는 한쌍이라고 보면 됩니다.
[root@localhost ~]# rpm -qR xterm
/bin/sh
/bin/sh
/bin/sh
/bin/sh
libICE.so.6()(64bit)
libX11.so.6()(64bit)
libXaw.so.7()(64bit)
libXft.so.2()(64bit)
libXmu.so.6()(64bit)
libXpm.so.4()(64bit)
libXt.so.6()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.11)(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.15)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libfontconfig.so.1()(64bit)
libtinfo.so.5()(64bit)
libutempter.so.0()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
rpmlib(PayloadIsXz) <= 5.2-1
qR은 패키지의 의존성을 확인할 때 사용한다.
[root@localhost ~]# rpm -qi xterm
Name : xterm
Version : 295
Release : 3.el7
Architecture: x86_64
Install Date: 2018년 08월 17일 (금) 오전 10시 52분 49초
Group : User Interface/X
Size : 1277972
License : MIT
Signature : RSA/SHA256, 2014년 07월 04일 (금) 오후 02시 51분 42초, Key ID 24c6a8a7f4a80eb5
Source RPM : xterm-295-3.el7.src.rpm
Build Date : 2014년 06월 10일 (화) 오전 06시 41분 47초
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://invisible-island.net/xterm
Summary : Terminal emulator for the X Window System
Description :
The xterm program is a terminal emulator for the X Window System. It
provides DEC VT102 and Tektronix 4014 compatible terminals for
programs that can't use the window system directly.
설치된 패키지 상세 정보는 위와 같이 확인
[root@localhost ~]# cd /run/media/master/CentOS\ 7\ x86_64/Packages/
[root@localhost Packages]# ls -l vsf*
-rw-rw-r--. 1 master master 173060 8월 11 2017 vsftpd-3.0.2-22.el7.x86_64.rpm
[root@localhost Packages]# rpm -qip ./vsftpd-3.0.2-22.el7.x86_64.rpm
Name : vsftpd
Version : 3.0.2
Release : 22.el7
Architecture: x86_64
Install Date: (not installed)
Group : System Environment/Daemons
Size : 356236
License : GPLv2 with exceptions
Signature : RSA/SHA256, 2017년 08월 11일 (금) 오전 05시 17분 26초, Key ID 24c6a8a7f4a80eb5
Source RPM : vsftpd-3.0.2-22.el7.src.rpm
Build Date : 2017년 08월 03일 (목) 오후 03시 10분 20초
Build Host : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : https://security.appspot.com/vsftpd.html
Summary : Very Secure Ftp Daemon
Description :
vsftpd is a Very Secure FTP daemon. It was written completely from
scratch.
설치하지 않은 패키지의 상세 정보를 확인할 때는 위와 같이 한다
[root@localhost ~]# rpm -e xterm
[root@localhost ~]# xterm
-bash: /bin/xterm: 그런 파일이나 디렉터리가 없습니다
yum을 이용한 패키지 설치
[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirrors.ustc.edu.cn
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,911
*!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,646
extras/7/x86_64 CentOS-7 - Extras 370
updates/7/x86_64 CentOS-7 - Updates 1,054
repolist: 23,981
[root@localhost ~]# yum list updates
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Updated Packages
centos-release.x86_64 7-5.1804.4.el7.centos updates
kernel.x86_64 3.10.0-862.11.6.el7 updates
kernel-devel.x86_64 3.10.0-862.11.6.el7 updates
kernel-headers.x86_64 3.10.0-862.11.6.el7 updates
kernel-tools.x86_64 3.10.0-862.11.6.el7 updates
kernel-tools-libs.x86_64 3.10.0-862.11.6.el7 updates
python-perf.x86_64 3.10.0-862.11.6.el7 updates
[root@localhost ~]# yum list | grep xterm
xterm.x86_64 295-3.el7 base
[root@localhost ~]# yum info xterm
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Available Packages
Name : xterm
Arch : x86_64
Version : 295
Release : 3.el7
Size : 455 k
Repo : base/7/x86_64
Summary : Terminal emulator for the X Window System
URL : http://invisible-island.net/xterm
License : MIT
Description : The xterm program is a terminal emulator for the X Window
: System. It provides DEC VT102 and Tektronix 4014 compatible
: terminals for programs that can't use the window system
: directly.
[master@localhost ~]$ yum info xterm
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: mirror.kakao.com
* epel: mirror01.idc.hinet.net
* extras: mirror.kakao.com
* updates: mirror.kakao.com
epel 12647/12647
Available Packages
Name : xterm
Arch : x86_64
Version : 295
Release : 3.el7
Size : 455 k
Repo : base/7/x86_64
Summary : Terminal emulator for the X Window System
URL : http://invisible-island.net/xterm
License : MIT
Description : The xterm program is a terminal emulator for the X Window
: System. It provides DEC VT102 and Tektronix 4014 compatible
: terminals for programs that can't use the window system
: directly.
[master@localhost ~]$ yum install xterm
Loaded plugins: fastestmirror, langpacks
You need to be root to perform this command.
마스터에서 xterm 설치하려고 하니 root로 가라고 함
[root@localhost ~]# yum install xterm
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Resolving Dependencies
--> Running transaction check
---> Package xterm.x86_64 0:295-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
xterm x86_64 295-3.el7 base 455 k
Transaction Summary
=============================================================================
Install 1 Package
Total download size: 455 k
Installed size: 1.2 M
Is this ok [y/d/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2018-08-17.11-21.tvrxgr.yumtx
yum -y install xterm 하면 닥치고 깜
패키지 설치하기
[root@localhost ~]# yum install autotrace
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Resolving Dependencies
--> Running transaction check
---> Package autotrace.x86_64 0:0.31.1-37.el7 will be installed
--> Processing Dependency: libMagickCore.so.5()(64bit) for package: autotrace-0.31.1-37.el7.x86_64
--> Running transaction check
---> Package ImageMagick.x86_64 0:6.7.8.9-15.el7_2 will be installed
--> Processing Dependency: libwmflite-0.2.so.7()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libImath.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIlmThread.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIlmImf.so.7()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIexMath.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIex.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libHalf.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Running transaction check
---> Package OpenEXR-libs.x86_64 0:1.7.1-7.el7 will be installed
---> Package ilmbase.x86_64 0:1.0.3-7.el7 will be installed
---> Package libwmf-lite.x86_64 0:0.2.8.4-41.el7_1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
autotrace x86_64 0.31.1-37.el7 base 132 k
Installing for dependencies:
ImageMagick x86_64 6.7.8.9-15.el7_2 base 2.1 M
OpenEXR-libs x86_64 1.7.1-7.el7 base 217 k
ilmbase x86_64 1.0.3-7.el7 base 100 k
libwmf-lite x86_64 0.2.8.4-41.el7_1 base 66 k
Transaction Summary
=============================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 2.6 M
Installed size: 9.4 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): autotrace-0.31.1-37.el7.x86_64.rpm | 132 kB 00:00
(2/5): ilmbase-1.0.3-7.el7.x86_64.rpm | 100 kB 00:00
(3/5): OpenEXR-libs-1.7.1-7.el7.x86_64.rpm | 217 kB 00:00
(4/5): libwmf-lite-0.2.8.4-41.el7_1.x86_64.rpm | 66 kB 00:00
(5/5): ImageMagick-6.7.8.9-15.el7_2.x86_64.rpm | 2.1 MB 00:00
-----------------------------------------------------------------------------
Total 3.1 MB/s | 2.6 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : ilmbase-1.0.3-7.el7.x86_64 1/5
Installing : OpenEXR-libs-1.7.1-7.el7.x86_64 2/5
Installing : libwmf-lite-0.2.8.4-41.el7_1.x86_64 3/5
Installing : ImageMagick-6.7.8.9-15.el7_2.x86_64 4/5
Installing : autotrace-0.31.1-37.el7.x86_64 5/5
Verifying : ilmbase-1.0.3-7.el7.x86_64 1/5
Verifying : autotrace-0.31.1-37.el7.x86_64 2/5
Verifying : ImageMagick-6.7.8.9-15.el7_2.x86_64 3/5
Verifying : libwmf-lite-0.2.8.4-41.el7_1.x86_64 4/5
Verifying : OpenEXR-libs-1.7.1-7.el7.x86_64 5/5
Installed:
autotrace.x86_64 0:0.31.1-37.el7
Dependency Installed:
ImageMagick.x86_64 0:6.7.8.9-15.el7_2
OpenEXR-libs.x86_64 0:1.7.1-7.el7
ilmbase.x86_64 0:1.0.3-7.el7
libwmf-lite.x86_64 0:0.2.8.4-41.el7_1
Complete!
패키지 삭제하기 : yum remove 패키지명
[root@localhost ~]# yum remove autotrace
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package autotrace.x86_64 0:0.31.1-37.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
autotrace x86_64 0.31.1-37.el7 @base 345 k
Transaction Summary
=============================================================================
Remove 1 Package
Installed size: 345 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : autotrace-0.31.1-37.el7.x86_64 1/1
Verifying : autotrace-0.31.1-37.el7.x86_64 1/1
Removed:
autotrace.x86_64 0:0.31.1-37.el7
Complete!
의존성은 지워지지 않는다
파일 아카이브와 압축
[master@localhost ~]$ ls -l
합계 3648
-rw-rw-r--. 1 master master 425 8월 13 17:20 HelloWorld.class
-rw-rw-r--. 1 master master 114 8월 13 17:19 HelloWorld.java
-rw-rw-r--. 1 master master 668 8월 16 13:09 counter.class
-rw-rw-r--. 1 master master 138 8월 16 10:52 counter.java
-rw-r--r--. 1 master master 1427 8월 17 11:10 crontab.out
drwxrwxr-x. 8 master master 191 8월 16 15:48 eclipse
drwxrwxr-x. 5 master master 60 8월 16 15:17 eclipse-workspace
-rw-rw-r--. 1 master master 3698892 8월 16 11:40 ojdbc7.jar
drwxrwxr-x. 2 master master 6 8월 14 12:30 sub1
-rw-rw-r--. 1 master master 2111 8월 16 12:37 tableloader.class
-rw-rw-r--. 1 master master 1122 8월 16 12:37 tableloader.java
-rwxrw-r--. 1 master master 896 8월 16 11:09 test.txt
-rw-rw-r--. 1 tester1 tester1 0 8월 14 12:19 test1.txt
-rw-rw-r--. 1 tester1 tester1 0 8월 14 12:21 test2.txt
drwxr-xr-x. 2 master master 6 8월 13 20:18 공개
drwxr-xr-x. 3 master master 125 8월 16 15:04 다운로드
drwxr-xr-x. 2 master master 6 8월 13 20:18 문서
drwxr-xr-x. 2 master master 40 8월 16 11:18 바탕화면
drwxr-xr-x. 2 master master 6 8월 13 20:18 비디오
drwxr-xr-x. 2 master master 6 8월 13 20:18 사진
drwxr-xr-x. 2 master master 6 8월 13 20:18 서식
drwxr-xr-x. 2 master master 6 8월 13 20:18 음악
[master@localhost ~]$ mkdir data
[master@localhost ~]$ cd /dta
bash: cd: /dta: 그런 파일이나 디렉터리가 없습니다
[master@localhost ~]$ cd data
[master@localhost data]$ touch test1.txt test2.txt test3.txt test4.txt
[master@localhost data]$ ls
test1.txt test2.txt test3.txt test4.txt
[master@localhost data]$ mkdir sub1 sub2
[master@localhost data]$ ls
sub1 sub2 test1.txt test2.txt test3.txt test4.txt
[master@localhost data]$ tar cvf backup.tar sub1/ sub2/ test1.txt test2.txt test3.txt test4.txt
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
[master@localhost data]$ ls
backup.tar sub1 sub2 test1.txt test2.txt test3.txt test4.txt
[master@localhost data]$ rm -r sub1 sub2/ test*
[master@localhost data]$ ls
backup.tar
backup.tar 에 들어있는 파일 확인
[master@localhost data]$ tar tvf backup.tar
drwxrwxr-x master/master 0 2018-08-17 11:49 sub1/
drwxrwxr-x master/master 0 2018-08-17 11:49 sub2/
-rw-rw-r-- master/master 0 2018-08-17 11:49 test1.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test2.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test3.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test4.txt
backup.tar에 test5.txt 추가
[master@localhost data]$ touch test5.txt
[master@localhost data]$ tar uvf backup.tar test5.txt
test5.txt
[master@localhost data]$ tar tvf backup.tar
drwxrwxr-x master/master 0 2018-08-17 11:49 sub1/
drwxrwxr-x master/master 0 2018-08-17 11:49 sub2/
-rw-rw-r-- master/master 0 2018-08-17 11:49 test1.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test2.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test3.txt
-rw-rw-r-- master/master 0 2018-08-17 11:49 test4.txt
-rw-rw-r-- master/master 0 2018-08-17 11:54 test5.txt
[master@localhost data]$ ls
backup.tar test5.txt
[master@localhost data]$ rm test5.txt
[master@localhost data]$ tar xvf backup.tar
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
test5.txt
[master@localhost data]$ ls
backup.tar sub2 test2.txt test4.txt
sub1 test1.txt test3.txt test5.txt
함축적 사용 방법
[master@localhost data]$ tar cvf backup2.tar s* test*
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
test5.txt
[master@localhost data]$ lsd
bash: lsd: 명령을 찾을 수 없습니다...
[master@localhost data]$ ls
backup.tar sub1 test1.txt test3.txt test5.txt
backup2.tar sub2 test2.txt test4.txt
파일 압축하기 : gzip / gunzip - .gz 파일
압축하기
[master@localhost data]$ ls
backup.tar backup2.tar
[master@localhost data]$ gzip backup.tar
[master@localhost data]$ ls
backup.tar.gz backup2.tar
[master@localhost data]$ gzip backup2.tar
[master@localhost data]$ ls
backup.tar.gz backup2.tar.gz
[master@localhost data]$ gzip -l backup.tar.gz
compressed uncompressed ratio uncompressed_name
198 10240 98.3% backup.tar
압축 풀기
[master@localhost data]$ gunzip backup.tar.gz
[master@localhost data]$ ls
backup.tar backup2.tar.gz
[master@localhost data]$ gunzip backup2.tar.gz
[master@localhost data]$ ls
backup.tar backup2.tar
다른 압축 푸는 방법
[master@localhost data]$ gzip backup.tar
[master@localhost data]$ ls
backup.tar.gz backup2.tar
[master@localhost data]$ gzip -d backup.tar.gz
[master@localhost data]$ ls
backup.tar backup2.tar
한방에 압축하고 압축 푸는 방법
[master@localhost data]$ ls
backup.tar backup2.tar
[master@localhost data]$ tar xvf backup.tar
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
test5.txt
[master@localhost data]$ ls
backup.tar sub1 test1.txt test3.txt test5.txt
backup2.tar sub2 test2.txt test4.txt
[master@localhost data]$ tar cvzf backup.tar.gz s* t*
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
test5.txt
[master@localhost data]$ ls
backup.tar backup2.tar sub2 test2.txt test4.txt
backup.tar.gz sub1 test1.txt test3.txt test5.txt
[master@localhost data]$ rm -r s* t*
[master@localhost data]$ ls
backup.tar backup.tar.gz backup2.tar
[master@localhost data]$ tar xvzf backup.tar.gz
sub1/
sub2/
test1.txt
test2.txt
test3.txt
test4.txt
test5.txt
톰캣 설치하기
jsvc 빌드(선택사항)
톰캣 폴더에 대한 사용자 계정 권한 부여
포트 변경
방화벽 설정
톰캣 키고 끄기
방화벽 풀기 - 여기부턴 강사님이 알려준 버전
[master@localhost ~]$ su - root
암호:
마지막 로그인: 금 8월 17 10:16:12 KST 2018 일시 pts/1
[root@localhost ~]# cd /usr/lib/fir
firewalld/ firmware/
[root@localhost ~]# cd /usr/lib/firewalld/services/
[root@localhost services]# cp http.xml tomcat.xml
[root@localhost services]# vi tomcat.xml
tomcat.xml을 아래와 같이 수정한다
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>TOMCAT (HTTP)</short>
<description></description>
<port protocol="tcp" port="8080"/>
</service>
[root@localhost services]# firewall-cmd --permanent --zone=public --add-service=tomcat
success
[root@localhost services]# firewall-cmd --reload
success
[master@localhost ~]$ ./apache-tomcat-8.5.32/bin/startup.sh
Using CATALINA_BASE: /home/master/apache-tomcat-8.5.32
Using CATALINA_HOME: /home/master/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /home/master/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/master/apache-tomcat-8.5.32/bin/bootstrap.jar:/home/master/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
port 9090으로 변경
[master@localhost ~]$ cd ./apache-tomcat-8.5.32/conf/
[master@localhost conf]$ ls
Catalina context.xml logging.properties tomcat-users.xsd
catalina.policy jaspic-providers.xml server.xml web.xml
catalina.properties jaspic-providers.xsd tomcat-users.xml
[master@localhost conf]$ vi server.xml
[master@localhost ~]$ ./apache-tomcat-8.5.32/bin/startup.sh
Using CATALINA_BASE: /home/master/apache-tomcat-8.5.32
Using CATALINA_HOME: /home/master/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /home/master/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/master/apache-tomcat-8.5.32/bin/bootstrap.jar:/home/master/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
root에서 아래와 같이 명령을 준다
[root@localhost ~]# cd /usr/bin/lib/fir
-bash: cd: /usr/bin/lib/fir: 그런 파일이나 디렉터리가 없습니다
[root@localhost ~]# cd /usr/lib/firewalld/services/
[root@localhost services]# vi tomcat.xml
[root@localhost services]# firewall-cmd --permanent --zone=public --add-service=tomcat
Warning: ALREADY_ENABLED: tomcat
success
[root@localhost services]# firewall-cmd --reload
success
마스터에서 톰캣을 껏다가 다시 켜준다
[master@localhost ~]$ ./apache-tomcat-8.5.32/bin/shutdown.sh
Using CATALINA_BASE: /home/master/apache-tomcat-8.5.32
Using CATALINA_HOME: /home/master/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /home/master/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/master/apache-tomcat-8.5.32/bin/bootstrap.jar:/home/master/apache-tomcat-8.5.32/bin/tomcat-juli.jar
[master@localhost ~]$ ./apache-tomcat-8.5.32/bin/startup.sh
Using CATALINA_BASE: /home/master/apache-tomcat-8.5.32
Using CATALINA_HOME: /home/master/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /home/master/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/master/apache-tomcat-8.5.32/bin/bootstrap.jar:/home/master/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
원격으로 리눅스에 접근해서 -- 관리
putty - sshd : ssh(secure shel)d(daemon) 원격 관리용 서버프로그램
https://www.putty.org/
root에서 아래와 같이 확인한다
[root@localhost services]# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since 금 2018-08-17 13:08:31 KST; 1h 37min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1150 (sshd)
Tasks: 1
CGroup: /system.slice/sshd.service
└─1150 /usr/sbin/sshd -D
8월 17 13:08:26 localhost.localdomain systemd[1]: Starting OpenSSH server daem....
8월 17 13:08:31 localhost.localdomain sshd[1150]: Server listening on 0.0.0.0 ....
8월 17 13:08:31 localhost.localdomain sshd[1150]: Server listening on :: port 22.
8월 17 13:08:31 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
Hint: Some lines were ellipsized, use -l to show in full.
active 중인것을 inactive 하자
[root@localhost services]# systemctl stop sshd
[root@localhost services]# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: inactive (dead) since 금 2018-08-17 14:47:46 KST; 3s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 1150 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 1150 (code=exited, status=0/SUCCESS)
8월 17 13:08:26 localhost.localdomain systemd[1]: Starting OpenSSH server daem....
8월 17 13:08:31 localhost.localdomain sshd[1150]: Server listening on 0.0.0.0 ....
8월 17 13:08:31 localhost.localdomain sshd[1150]: Server listening on :: port 22.
8월 17 13:08:31 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
8월 17 14:47:46 localhost.localdomain systemd[1]: Stopping OpenSSH server daem....
8월 17 14:47:46 localhost.localdomain systemd[1]: Stopped OpenSSH server daemon.
Hint: Some lines were ellipsized, use -l to show in full.
다시 시작하자
[root@localhost services]# systemctl start sshd
[root@localhost services]# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since 금 2018-08-17 14:48:25 KST; 1s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 5322 (sshd)
Tasks: 1
CGroup: /system.slice/sshd.service
└─5322 /usr/sbin/sshd -D
8월 17 14:48:25 localhost.localdomain systemd[1]: Starting OpenSSH server daem....
8월 17 14:48:25 localhost.localdomain sshd[5322]: Server listening on 0.0.0.0 ....
8월 17 14:48:25 localhost.localdomain sshd[5322]: Server listening on :: port 22.
8월 17 14:48:25 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
Hint: Some lines were ellipsized, use -l to show in full.
설치한 putty를 실행해보자
톰캣을 키고 싶으면
login as: master
master@192.168.111.128's password:
Last login: Fri Aug 17 14:54:01 2018 from 192.168.111.1
[master@localhost ~]$ ./apache-tomcat-8.5.32/bin/startup.sh
Using CATALINA_BASE: /home/master/apache-tomcat-8.5.32
Using CATALINA_HOME: /home/master/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /home/master/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /home/master/apache-tomcat-8.5.32/bin/bootstrap.jar:/home/master/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
이후 모든 리눅스 작업은 원격으로 접근해서 작업한다
자바를 컴파일 해보자
[master@localhost ~]$ ls
apache-tomcat-8.5.32 eclipse-workspace 다운로드 비디오 음악
apache-tomcat-8.5.32.tar.gz ojdbc7.jar 문서 사진
eclipse 공개 바탕화면 서식
[master@localhost ~]$ vi HelloWorld.java
[master@localhost ~]$ vi HelloWorld.java
[master@localhost ~]$ ls
HelloWorld.java eclipse 공개 바탕화면 서식
apache-tomcat-8.5.32 eclipse-workspace 다운로드 비디오 음악
apache-tomcat-8.5.32.tar.gz ojdbc7.jar 문서 사진
[master@localhost ~]$ vi HelloWorld.java
[마지막으로 고친 뒤 저장 안 함]
[master@localhost ~]$ ls
HelloWorld.java eclipse 공개 바탕화면 서식
apache-tomcat-8.5.32 eclipse-workspace 다운로드 비디오 음악
apache-tomcat-8.5.32.tar.gz ojdbc7.jar 문서 사진
[master@localhost ~]$ javac HelloWorld.java
[master@localhost ~]$ java HelloWorld
안녕 자바
[master@localhost ~]$ exit
exit
FTP 서버
FTP
File Transfer Protocol Daemon
filezilla <- file (20, 21(*)) -> 서버
linux 파일 변동을 모니터링하는 시스템
= selinux을 풀어줘야한다.
= 동작후 리부팅
[root@localhost ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
~
~
~
~
~
~
~
~
"/etc/selinux/config" 14L, 547C
SELINUX=enforcing을 아래와 같이 SELINUX=permissive로 바꾼다
ot@localhost ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
~
~
~
~
~
~
restart session하고 다시 마스터로 들어가서 루트로 접근한다
login as: master
master@192.168.111.128's password:
Last login: Fri Aug 17 14:57:15 2018 from 192.168.111.1
[master@localhost ~]$ su - root
암호:
마지막 로그인: 금 8월 17 15:14:54 KST 2018 일시 :0
[root@localhost ~]# cd /usr/lib/firewalld/services/
[root@localhost services]# ls
RH-Satellite-6.xml kadmin.xml quassel.xml
amanda-client.xml kerberos.xml radius.xml
amanda-k5-client.xml kibana.xml rpc-bind.xml
bacula-client.xml klogin.xml rsh.xml
bacula.xml kpasswd.xml rsyncd.xml
bitcoin-rpc.xml kshell.xml samba-client.xml
bitcoin-testnet-rpc.xml ldap.xml samba.xml
bitcoin-testnet.xml ldaps.xml sane.xml
bitcoin.xml libvirt-tls.xml sip.xml
ceph-mon.xml libvirt.xml sips.xml
ceph.xml managesieve.xml smtp-submission.xml
cfengine.xml mdns.xml smtp.xml
condor-collector.xml mosh.xml smtps.xml
ctdb.xml mountd.xml snmp.xml
dhcp.xml ms-wbt.xml snmptrap.xml
dhcpv6-client.xml mssql.xml spideroak-lansync.xml
dhcpv6.xml mysql.xml squid.xml
dns.xml nfs.xml ssh.xml
docker-registry.xml nfs3.xml synergy.xml
dropbox-lansync.xml nrpe.xml syslog-tls.xml
elasticsearch.xml ntp.xml syslog.xml
freeipa-ldap.xml openvpn.xml telnet.xml
freeipa-ldaps.xml ovirt-imageio.xml tftp-client.xml
freeipa-replication.xml ovirt-storageconsole.xml tftp.xml
freeipa-trust.xml ovirt-vmconsole.xml tinc.xml
ftp.xml pmcd.xml tomcat.xml
ganglia-client.xml pmproxy.xml tor-socks.xml
ganglia-master.xml pmwebapi.xml transmission-client.xml
high-availability.xml pmwebapis.xml vdsm.xml
http.xml pop3.xml vnc-server.xml
https.xml pop3s.xml wbem-https.xml
imap.xml postgresql.xml xmpp-bosh.xml
imaps.xml privoxy.xml xmpp-client.xml
ipp-client.xml proxy-dhcp.xml xmpp-local.xml
ipp.xml ptp.xml xmpp-server.xml
ipsec.xml pulseaudio.xml
iscsi-target.xml puppetmaster.xml
[root@localhost services]# vi ftp.xml
vsftpd를 깔자
[root@localhost services]# yum list vsftpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Available Packages
vsftpd.x86_64 3.0.2-22.el7 base
[root@localhost services]# yum -y install vsftpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.kaist.ac.kr
* epel: mirror01.idc.hinet.net
* extras: ftp.kaist.ac.kr
* updates: ftp.kaist.ac.kr
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-22.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
vsftpd x86_64 3.0.2-22.el7 base 169 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 169 k
Installed size: 348 k
Downloading packages:
vsftpd-3.0.2-22.el7.x86_64.rpm | 169 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : vsftpd-3.0.2-22.el7.x86_64 1/1
Verifying : vsftpd-3.0.2-22.el7.x86_64 1/1
Installed:
vsftpd.x86_64 0:3.0.2-22.el7
Complete!
[root@localhost services]# firewall-cmd --permanent --zone=public --add-service=tomcat
Warning: ALREADY_ENABLED: ftp
success
[root@localhost services]# firewall-cmd --reload
success
[root@localhost services]# systemctl start vsftpd
'Web & Mobile > Linux' 카테고리의 다른 글
Lecture 68 - Linux(6) vsftpd 사용법, Linux에 MariaDB 설치법, Model1 게시판과 연동법 (0) | 2019.06.24 |
---|---|
Lecture 67 - Linux(5) 네트워크, 원격관리 (0) | 2019.06.21 |
Lecture 65 - Linux(3) 작업예약, at, crontab (0) | 2019.06.19 |
Lecture 64 - Linux(2) 사용자 계정 관리, 로그인 관리 (0) | 2019.06.18 |
Lecture 63 - Linux(1) 리눅스의 기초 (0) | 2019.06.17 |
댓글