티스토리 뷰
728x90
2024.05.25 - [개발/리눅스] - 개발 환경 구축하기 #1
1. 설치 후 로그인
2. 인터넷 연결
$ vi /etc/sysconfig/network-scripts/ifcfg-ens33
ONBOOT = YES
$ systemctl restart network
$ ip addr 확인
3. SSH로 연결
4. 레포 URL 변경하기
CentOS 7의 레포지토리 URL을 수정하려면 다음 단계를 따르십시오.
여기서는 기본 CentOS 레포지토리 파일을 수정하는 방법을 설명합니다.
현재 레포지토리 파일 백업
먼저, 현재 사용 중인 레포지토리 파일을 백업해 두는 것이 좋습니다.
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
레포지토리 파일 수정
vi 또는 nano와 같은 텍스트 편집기를 사용하여 레포지토리 파일을 엽니다.
sudo vi /etc/yum.repos.d/CentOS-Base.repo
sudo nano /etc/yum.repos.d/CentOS-Base.repo
레포지토리 URL 수정
레포지토리 파일의 내용을 수정합니다. 예를 들어, baseurl 항목을 원하는 URL로 변경합니다. 아래는 CentOS-Base.repo 파일의 예시입니다.
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
baseurl을 원하는 새로운 URL로 변경하십시오.
YUM 캐시 삭제
변경 사항을 적용하려면 YUM 캐시를 삭제합니다.
$ sudo yum clean all
$ sudo yum makecache
변경 사항 확인
YUM을 사용하여 패키지를 업데이트하거나 설치하여 새로운 레포지토리 설정이 제대로 적용되었는지 확인합니다.
$ sudo yum update
위 단계를 따라 레포지토리 URL을 수정할 수 있습니다. 문제가 발생할 경우 백업 파일을 사용하여 원래 상태로 복구할 수 있습니다.
# CentOS Vault contains rpms from older releases in the CentOS-7
# tree.
# C7.0.1406
[C7.0.1406-base]
name=CentOS-7.0.1406 - Base
baseurl=http://vault.centos.org/7.0.1406/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.0.1406-updates]
name=CentOS-7.0.1406 - Updates
baseurl=http://vault.centos.org/7.0.1406/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.0.1406-extras]
name=CentOS-7.0.1406 - Extras
baseurl=http://vault.centos.org/7.0.1406/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.0.1406-centosplus]
name=CentOS-7.0.1406 - CentOSPlus
baseurl=http://vault.centos.org/7.0.1406/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.0.1406-fasttrack]
name=CentOS-7.0.1406 - Fasttrack
baseurl=http://vault.centos.org/7.0.1406/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
# C7.1.1503
[C7.1.1503-base]
name=CentOS-7.1.1503 - Base
baseurl=http://vault.centos.org/7.1.1503/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.1.1503-updates]
name=CentOS-7.1.1503 - Updates
baseurl=http://vault.centos.org/7.1.1503/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.1.1503-extras]
name=CentOS-7.1.1503 - Extras
baseurl=http://vault.centos.org/7.1.1503/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.1.1503-centosplus]
name=CentOS-7.1.1503 - CentOSPlus
baseurl=http://vault.centos.org/7.1.1503/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.1.1503-fasttrack]
name=CentOS-7.1.1503 - Fasttrack
baseurl=http://vault.centos.org/7.1.1503/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
# C7.2.1511
[C7.2.1511-base]
name=CentOS-7.2.1511 - Base
baseurl=http://vault.centos.org/7.2.1511/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.2.1511-updates]
name=CentOS-7.2.1511 - Updates
baseurl=http://vault.centos.org/7.2.1511/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.2.1511-extras]
name=CentOS-7.2.1511 - Extras
baseurl=http://vault.centos.org/7.2.1511/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.2.1511-centosplus]
name=CentOS-7.2.1511 - CentOSPlus
baseurl=http://vault.centos.org/7.2.1511/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.2.1511-fasttrack]
name=CentOS-7.2.1511 - Fasttrack
baseurl=http://vault.centos.org/7.2.1511/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
# C7.3.1611
[C7.3.1611-base]
name=CentOS-7.3.1611 - Base
baseurl=http://vault.centos.org/7.3.1611/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.3.1611-updates]
name=CentOS-7.3.1611 - Updates
baseurl=http://vault.centos.org/7.3.1611/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.3.1611-extras]
name=CentOS-7.3.1611 - Extras
baseurl=http://vault.centos.org/7.3.1611/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.3.1611-centosplus]
name=CentOS-7.3.1611 - CentOSPlus
baseurl=http://vault.centos.org/7.3.1611/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.3.1611-fasttrack]
name=CentOS-7.3.1611 - Fasttrack
baseurl=http://vault.centos.org/7.3.1611/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
# C7.4.1708
[C7.4.1708-base]
name=CentOS-7.4.1708 - Base
baseurl=http://vault.centos.org/7.4.1708/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.4.1708-updates]
name=CentOS-7.4.1708 - Updates
baseurl=http://vault.centos.org/7.4.1708/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.4.1708-extras]
name=CentOS-7.4.1708 - Extras
baseurl=http://vault.centos.org/7.4.1708/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.4.1708-centosplus]
name=CentOS-7.4.1708 - CentOSPlus
baseurl=http://vault.centos.org/7.4.1708/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.4.1708-fasttrack]
name=CentOS-7.4.1708 - Fasttrack
baseurl=http://vault.centos.org/7.4.1708/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
# C7.5.1804
[C7.5.1804-base]
name=CentOS-7.5.1804 - Base
baseurl=http://vault.centos.org/7.5.1804/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.5.1804-updates]
name=CentOS-7.5.1804 - Updates
baseurl=http://vault.centos.org/7.5.1804/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.5.1804-extras]
name=CentOS-7.5.1804 - Extras
baseurl=http://vault.centos.org/7.5.1804/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.5.1804-centosplus]
name=CentOS-7.5.1804 - CentOSPlus
baseurl=http://vault.centos.org/7.5.1804/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[C7.5.1804-fasttrack]
name=CentOS-7.5.1804 - Fasttrack
baseurl=http://vault.centos.org/7.5.1804/fasttrack/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.kakao.com/centos/$releasever/os/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
# kakao
baseurl=http://mirror.kakao.com/centos/$releasever/updates/$basearch
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://centos.mirror.cdnetworks.com/$releasever/extras/$basearch
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://centos.mirror.cdnetworks.com/$releasever/centosplus/$basearch
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://centos.mirror.cdnetworks.com/$releasever/contrib/$basearch
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
5. 필수 프로그램 설치
sudo yum -y install psmisc
sudo yum -y install net-tools
sudo yum -y install wget
sudo yum install tar bzip2
sudo yum install epel-release
sudo yum install perl-IPC-Cmd
sudo yum install perl-core
sudo yum -y groupinstall "Development Tools"
sudo yum -y install kernel-devel kernel-headers
sudo yum -y install cmake
sudo yum -y install make
sudo yum -y install gcc gcc-c++
sudo yum -y install glibc glibc-devel
sudo yum -y install openssl-devel
sudo yum -y install libtool autoconf
sudo yum -y install epel-release
sudo yum -y install dkms
6. 필수 라이브러리 설치
6.1. OpenSSL 3.1 설치
cd /usr/local/src
sudo wget https://www.openssl.org/source/openssl-3.1.0.tar.gz
sudo tar -xzvf openssl-3.1.0.tar.gz
cd openssl-3.1.0
sudo ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
sudo make
sudo make test
sudo make install
sudo sh -c 'echo "export PATH=/usr/local/openssl/bin:\$PATH" > /etc/profile.d/openssl.sh'
sudo sh -c 'echo "export LD_LIBRARY_PATH=/usr/local/openssl/lib:\$LD_LIBRARY_PATH" >> /etc/profile.d/openssl.sh'
source /etc/profile.d/openssl.sh
openssl version
6.2. GCC 최신 버전 설치 ( C++20 지원)
- 기본 설치
sudo yum install centos-release-scl
sudo yum install devtoolset-11
scl enable devtoolset-11 bash
- 소스
sudo yum groupinstall "Development Tools"
sudo yum install gmp-devel mpfr-devel libmpc-devel
cd /usr/local/src
sudo wget https://ftp.gnu.org/gnu/gcc/gcc-11.1.0/gcc-11.1.0.tar.gz
sudo tar -xzvf gcc-11.1.0.tar.gz
cd gcc-11.1.0
sudo mkdir gcc-build
cd gcc-build
sudo ../configure --enable-languages=c,c++ --disable-multilib
sudo make -j$(nproc)
sudo make install
6.3 GLIBC
sudo yum groupinstall "Development Tools"
sudo yum install wget
cd /usr/local/src
sudo wget http://ftp.gnu.org/gnu/libc/glibc-2.33.tar.gz # 최신 버전을 확인하여 URL을 변경하세요
sudo tar -xzvf glibc-2.33.tar.gz
cd glibc-2.33
sudo mkdir glibc-build
cd glibc-build
sudo ../configure --prefix=/opt/glibc-2.33
sudo make -j$(nproc)
sudo make install
export LD_LIBRARY_PATH=/opt/glibc-2.33/lib:$LD_LIBRARY_PATH
export PATH=/opt/glibc-2.33/bin:$PATH
#ERROR 발생시
#*** some features or tests will be disabled.
#*** Check the INSTALL file for required versions.
#checking LD_LIBRARY_PATH variable... contains current directory
#configure: error:
#*** LD_LIBRARY_PATH shouldn't contain the current directory when
#*** building glibc. Please change the environment variable
#*** and run configure again.
#[root@localhost glibc-build]# sudo make -j$(nproc)
#make: *** 타겟이 지정되지 않았고 메이크파일이 없습니다. 멈춤.
unset LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed -e 's/:*\.\(:\|$\)//g' -e 's/^\.\(:\|$\)//')
sudo yum install texinfo
cd /usr/local/src/glibc-2.33
sudo rm -rf glibc-build
sudo mkdir glibc-build
cd glibc-build
# configure 스크립트를 다시 실행
sudo ../configure --prefix=/opt/glibc-2.33
sudo make -j$(nproc)
sudo make install
반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 블루버블다이빙팀
- 외돌개
- OpenSource
- 암호화
- 서귀포블루버블
- PowerShell
- 블루버블다이브팀
- 현포다이브
- CMake
- C
- Effective c++
- 블루버블
- 스쿠버다이빙
- Build
- script
- 울릉도
- 네트워크 정보
- C#.NET
- Linux
- 패턴
- 서귀포
- effective
- C# 고급 기술
- 제주도
- C++
- C#
- Windows
- DLL
- 성산블루버블
- 스쿠버 다이빙
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
글 보관함
250x250