자식 설치 : sudo : apt-get : command not found


36

자식을 설치하려고합니다. 다음 명령을 실행합니다.

sudo apt-get install git-core git-gui git-doc

그러나 다음과 같은 오류가 발생합니다. sudo: apt-get: command not found

어떻게해야합니까?


5
어떤 Linux 배포판을 사용하고 있습니까?
jofel

나는 그것이 생각합니다2.6.9-023stab048.6-enterprise #1 SMP
Lucy Weatherford

1
죄송합니다CentOS release 5.2 (Final)
Lucy Weatherford

2
yum내가 실수하지 않으면 CentOS가 사용 합니다.
Lekensteyn

그래서 내가 무엇을해야하니? 내가 사용해야 할 혼수는 무엇입니까?
Lucy Weatherford

답변:


52

당신이에 CentOS 5를 사용하고 있기 때문에, 기본 패키지 관리자 입니다 yum,하지 apt-get. 프로그램을 사용하여 프로그램을 설치하려면 일반적으로 다음 명령을 사용하십시오.

$ sudo yum install <packagename>

그러나 이런 방법으로 git을 설치하려고하면 CentOS 5에서 다음과 같은 오류가 발생합니다.

$ sudo yum install git
Setting up Install Process
Parsing package install arguments
No package git available.
Nothing to do

이것에 대해 yum알고 있는 패키지 리포지토리 에는 설치할 필수 rpm (RPM 패키지 관리자 파일)이 포함되어 있지 않습니다 git. 이것은 CentOS 5가 2007 년에 출시 된 RHEL 5를 기반으로하기 때문일 것 git입니다. 이 문제를 해결하려면 yum사용 하는 목록에 추가 리포지토리를 추가해야 합니다 ( 이 지침에 따라 RPMforge 리포지토리를 추가하겠습니다 ).

이것은 i386 패키지를 원한다고 가정합니다. 를 실행하여 테스트하십시오 uname -i. x86_64 패키지를 원하는 경우 다음 명령에서 모든 i386을 x86_64로 바꾸십시오.

먼저 rpmforge-release패키지를 다운로드하십시오 .

$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm

다음으로 패키지를 확인하고 설치하십시오.

$ sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ rpm -K rpmforge-release-0.5.3-1.el5.rf.i386.rpm
$ sudo rpm -i rpmforge-release-0.5.3-1.el5.rf.i386.rpm

그리고 지금 우리는 설치할 수 있어야합니다 git:

$ sudo yum install git-gui

yum의존성을 해결하고 진행할지 여부를 관련 지점에서 묻습니다. yn또는 아니오를 누릅니다 return.


3
packages.sw.be이제 죽었을 것 같습니다 . 시간이 초과되었습니다.

그것은 부끄러운 일입니다. 그리고 시간이 지남에 따라 사람들에게 문제가 덜
Edd

소스에서 Git을 빌드하기 위해 아래 답변에 빌드 스크립트를 추가했습니다. 패키지와 함께 타사 리포지토리의 신뢰할 수있는 소스를 찾으려고 포기했습니다.

- Rpmforge 적어도 1 년 죽었 github.com/repoforge/rpms/issues/375

2

데비안 관련 배포판을 사용하고 있습니까? 그렇지 않은 경우 YUM (현재 Red Hat, CentOS 등), Portage, Entropy, RPM 등과 같은 다른 패키지 관리자를 사용해야 할 수도 있습니다.

데비안 관련 배포판을 사용하는 경우 :

무엇을 제공합니까?

$ command -V apt-get
apt-get is /usr/bin/apt-get

바이너리가 실제로 있습니까?

$ file /usr/bin/apt-get
/usr/bin/apt-get: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

답변 주셔서 감사합니다. 나는 -bash: command: apt-get: not found첫번째 것을 얻고있다 . 그리고 apt-get: ERROR: cannot open apt-get '(그러한 파일이나 디렉토리가 없음)`는 두 번째입니다. 그렇다면 이것이 무엇을 의미합니까? 거기에 없다고? 대체품이 있습니까? 어떻게 든 추가해야합니까? 어떻게? git을 설치하는 다른 방법이 있습니까? 감사합니다
Lucy Weatherford

@LucyWeatherford 데비안 관련 배포판을 사용하지 않는 것 같습니다. 어떤 배포판을 쉽게 찾을 수있는 방법은 현재 배포판을 lsb_release -a찾는 것입니다. Red Hat 또는 CentOS를 다시 사용하십시오.
alemani

그것은 m, 센 토스입니다. 그러면 yum으로 무엇을 시도해야합니까?
Lucy Weatherford

@LucyWeatherford [link] centos.org/docs/4/html/yum/sn-managing-packages.html 을 읽으 십시오. 배경이 APT 인 경우 YUM으로 패키지 관리의 기본 사항을 이해해야합니다. apt-get install <package_name>된다 yum install <package_name>다른 배포판은 다른 패키지 이름이 있음을 유의하십시오.
alemani

0

소스에서 Git을 기꺼이 빌드하려는 경우 다음이 도움이 될 수 있습니다. 그것들은 Noloader Github | 빌드 스크립트 . CentOS 5 및 MIPS ci20 dev 보드와 같은 오래된 OS에 사용합니다. 배포판은 더 이상 저장소를 유지 관리하지 않으므로 소프트웨어를 업데이트 할 수있는 유일한 방법입니다. Oracle은 업데이트를 얻기 위해 서비스 계약을 구매하기를 원하므로 Solaris와 같은 최신 OS에도이 스크립트가 유용합니다.

Git 스크립트는 다음과 같습니다. 여기에 답변에 실체가 있는지 확인하기 위해 추가되었습니다. 그러나 일부 패키지의 최신 릴리스를 얻기 위해 때때로 수정하기 때문에 GitHub로 돌아 가야합니다.

#!/usr/bin/env bash

# See fixup for INSTALL_LIBDIR below
INSTALL_PREFIX=/usr/local
INSTALL_LIBDIR="$INSTALL_PREFIX/lib64"

# OpenSSH can only use OpenSSL 1.0.2 at the moment
OPENSSL_TAR=openssl-1.0.2l.tar.gz
OPENSSL_DIR=openssl-1.0.2l
#OPENSSL_TAR=openssl-1.1.0e.tar.gz
#OPENSSL_DIR=openssl-1.1.0e

ZLIB_TAR=zlib-1.2.11.tar.gz
ZLIB_DIR=zlib-1.2.11

BZ2_TAR=bzip2-1.0.6.tar.gz
BZ2_DIR=bzip2-1.0.6

READLN_TAR=readline-7.0.tar.gz
READLN_DIR=readline-7.0

UNISTR_TAR=libunistring-0.9.7.tar.gz
UNISTR_DIR=libunistring-0.9.7

ICONV_TAR=libiconv-1.15.tar.gz
ICONV_DIR=libiconv-1.15

IDN2_TAR=libidn2-0.16.tar.gz
IDN2_DIR=libidn2-0.16

PCRE_TAR=pcre-8.40.tar.gz
PCRE_DIR=pcre-8.40

PCRE2_TAR=pcre2-10.23.tar.gz
PCRE2_DIR=pcre2-10.23

CURL_TAR=curl-7.54.0.tar.gz
CURL_DIR=curl-7.54.0

GIT_TAR=v2.13.0.tar.gz
GIT_DIR=git-2.13.0

# Unset to avoid using an existing trust store when configuring cURL.
# No trust store will be supplied for some OSes, like Solaris.
# Also see '/usr/bin/curl-config --ca' and '/usr/bin/curl-config --configure'
USE_TRUST_STORE=1

###############################################################################

# Autotools on Solaris has an implied requirement for GNU gear. Things fall apart without it.
# Also see https://blogs.oracle.com/partnertech/entry/preparing_for_the_upcoming_removal.
if [[ -d "/usr/gnu/bin" ]]; then
    if [[ ! ("$PATH" == *"/usr/gnu/bin"*) ]]; then
        echo
        echo "Adding /usr/gnu/bin to PATH for Solaris"
        PATH="/usr/gnu/bin:$PATH"
    fi
elif [[ -d "/usr/swf/bin" ]]; then
    if [[ ! ("$PATH" == *"/usr/sfw/bin"*) ]]; then
        echo
        echo "Adding /usr/sfw/bin to PATH for Solaris"
        PATH="/usr/sfw/bin:$PATH"
    fi
elif [[ -d "/usr/ucb/bin" ]]; then
    if [[ ! ("$PATH" == *"/usr/ucb/bin"*) ]]; then
        echo
        echo "Adding /usr/ucb/bin to PATH for Solaris"
        PATH="/usr/ucb/bin:$PATH"
    fi
fi

###############################################################################

if [[ -z `which autoreconf` ]]; then
    echo "Some packages require autoreconf. Please install autoconf or automake."
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

if [[ -z `which msgfmt` ]]; then
    echo "Git requires msgfmt. Please install gettext."
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

###############################################################################

echo
echo "If you enter a sudo password, then it will be used for installation."
echo "If you don't enter a password, then ensure INSTALL_PREFIX is writable."
echo "To avoid sudo and the password, just press ENTER and they won't be used."
read -s -p "Please enter password for sudo: " SUDO_PASSWWORD
echo

###############################################################################

THIS_SYSTEM=$(uname -s 2>&1)
IS_DARWIN=$(echo -n "$THIS_SYSTEM" | grep -i -c darwin)
IS_LINUX=$(echo -n "$THIS_SYSTEM" | grep -i -c linux)
IS_CYGWIN=$(echo -n "$THIS_SYSTEM" | grep -i -c cygwin)
IS_MINGW=$(echo -n "$THIS_SYSTEM" | grep -i -c mingw)
IS_OPENBSD=$(echo -n "$THIS_SYSTEM" | grep -i -c openbsd)
IS_DRAGONFLY=$(echo -n "$THIS_SYSTEM" | grep -i -c dragonfly)
IS_FREEBSD=$(echo -n "$THIS_SYSTEM" | grep -i -c freebsd)
IS_NETBSD=$(echo -n "$THIS_SYSTEM" | grep -i -c netbsd)
IS_SOLARIS=$(echo -n "$THIS_SYSTEM" | grep -i -c sunos)

if [[ ("$IS_FREEBSD" -eq "1" || "$IS_OPENBSD" -eq "1" || "$IS_NETBSD" -eq "1" || "$IS_DRAGONFLY" -eq "1" || "$IS_SOLARIS" -eq "1") ]]; then
    if [[ !(-z `which gmake 2>/dev/null | grep -v 'no gmake'`) ]]; then
        MAKE=gmake
    else
        MAKE=make
    fi
else
    MAKE=make
fi

# Try to determine 32 vs 64-bit, /usr/local/lib, /usr/local/lib32 and /usr/local/lib64
# The Autoconf programs misdetect Solaris as x86 even though its x64. OpenBSD has
# getconf, but it does not have LONG_BIT.
IS_64BIT=$(getconf LONG_BIT 2>&1 | grep -i -c 64)
if [[ "$IS_64BIT" -eq "0" ]]; then
    IS_64BIT=$(file /bin/ls 2>&1 | grep -i -c '64-bit')
fi

if [[ "$IS_SOLARIS" -eq "1" ]]; then
    SH_KBITS=64
    SH_MARCH=-m64
    INSTALL_LIBDIR="$INSTALL_PREFIX/lib64"
    INSTALL_LIBDIR_DIR="lib64"
elif [[ "$IS_64BIT" -eq "1" ]]; then
    if [[ (-d /usr/lib) && (-d /usr/lib32) ]]; then
        SH_KBITS=64
        SH_MARCH=-m64
        INSTALL_LIBDIR="$INSTALL_PREFIX/lib"
        INSTALL_LIBDIR_DIR="lib"
    elif [[ (-d /usr/lib) && (-d /usr/lib64) ]]; then
        SH_KBITS=64
        SH_MARCH=-m64
        INSTALL_LIBDIR="$INSTALL_PREFIX/lib64"
        INSTALL_LIBDIR_DIR="lib64"
    else
        SH_KBITS=64
        SH_MARCH=-m64
        INSTALL_LIBDIR="$INSTALL_PREFIX/lib"
        INSTALL_LIBDIR_DIR="lib"
    fi
else
    SH_KBITS=32
    SH_MARCH=-m32
    INSTALL_LIBDIR="$INSTALL_PREFIX/lib"
    INSTALL_LIBDIR_DIR="lib"
fi

if [[ -z "$CC" ]]; then CC=`which cc`; fi

MARCH_ERROR=`$CC $SH_MARCH -x c -c -o /dev/null - </dev/null 2>&1 | grep -i -c error`
if [[ "$MARCH_ERROR" -ne "0" ]]; then
    SH_MARCH=
fi

echo
echo "********** libdir **********"
echo
echo "Using libdir $INSTALL_LIBDIR"

###############################################################################

echo
echo "********** zLib **********"
echo

wget "http://www.zlib.net/$ZLIB_TAR" -O "$ZLIB_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download zLib"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$ZLIB_DIR" &>/dev/null
tar -xzf "$ZLIB_TAR"
cd "$ZLIB_DIR"

SH_LDLIBS=("-ldl -lpthread")
SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure zLib"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build zLib"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** Bzip **********"
echo

wget "http://www.bzip.org/1.0.6/$BZ2_TAR" -O "$BZ2_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download Bzip"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$BZ2_DIR" &>/dev/null
tar -xzf "$BZ2_TAR"
cd "$BZ2_DIR"

# Fix Bzip install paths
cp Makefile Makefile.orig
sed 's|$(PREFIX)/lib|$(LIBDIR)|g' Makefile.orig > Makefile
rm Makefile.orig
cp Makefile-libbz2_so Makefile-libbz2_so.orig
sed 's|$(PREFIX)/lib|$(LIBDIR)|g' Makefile-libbz2_so.orig > Makefile-libbz2_so
rm Makefile-libbz2_so.orig

# Fix Bzip cpu architecture
cp Makefile Makefile.orig
sed "s|CFLAGS=|CFLAGS=$SH_MARCH |g" Makefile.orig > Makefile
cp Makefile Makefile.orig
sed "s|CXXFLAGS=|CXXFLAGS=$SH_MARCH |g" Makefile.orig > Makefile
rm Makefile.orig
cp Makefile-libbz2_so Makefile-libbz2_so.orig
sed "s|CFLAGS=|CFLAGS=$SH_MARCH |g" Makefile-libbz2_so.orig > Makefile-libbz2_so
cp Makefile-libbz2_so Makefile-libbz2_so.orig
sed "s|CXXFLAGS=|CXXFLAGS=$SH_MARCH |g" Makefile-libbz2_so.orig > Makefile-libbz2_so
rm Makefile-libbz2_so.orig

# Add RPATH
cp Makefile Makefile.orig
sed "s|LDFLAGS=|LDFLAGS=$SH_MARCH -Wl,-rpath,$INSTALL_LIBDIR -L$INSTALL_LIBDIR|g" Makefile.orig > Makefile
rm Makefile.orig
cp Makefile-libbz2_so Makefile-libbz2_so.orig
sed "s|LDFLAGS=|LDFLAGS=$SH_MARCH -Wl,-rpath,$INSTALL_LIBDIR -L$INSTALL_LIBDIR|g" Makefile-libbz2_so.orig > Makefile-libbz2_so
rm Makefile-libbz2_so.orig

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build Bzip"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install PREFIX="$INSTALL_PREFIX" LIBDIR="$INSTALL_LIBDIR")
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** Unistring **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://ftp.gnu.org/gnu/libunistring/$UNISTR_TAR" --no-check-certificate -O "$UNISTR_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$UNISTR_DIR" &>/dev/null
tar -xzf "$UNISTR_TAR"
cd "$UNISTR_DIR"

SH_LDLIBS=("-ldl -lpthread")
SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** Readline **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://ftp.gnu.org/gnu/readline/$READLN_TAR" --no-check-certificate -O "$READLN_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download Readline"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$READLN_DIR" &>/dev/null
tar -xzf "$READLN_TAR"
cd "$READLN_DIR"

SH_LDLIBS=("-ldl" "-lpthread")
SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure Readline"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build Readline"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** iConvert **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://ftp.gnu.org/pub/gnu/libiconv/$ICONV_TAR" --no-check-certificate -O "$ICONV_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download iConvert"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$ICONV_DIR" &>/dev/null
tar -xzf "$ICONV_TAR"
cd "$ICONV_DIR"

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-ldl" "-lpthread")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure iConvert"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build iConvert"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** IDN2 **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://alpha.gnu.org/gnu/libidn/$IDN2_TAR" --no-check-certificate -O "$IDN2_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$IDN2_DIR" &>/dev/null
tar -xzf "$IDN2_TAR"
cd "$IDN2_DIR"

if [[ "$IS_SOLARIS" -eq "1" ]]; then
    cp src/idn2.c src/idn2.c.orig
    sed '/^#include "error.h"/d' src/idn2.c.orig > src/idn2.c
    cp src/idn2.c src/idn2.c.orig
    sed '43istatic void error (int status, int errnum, const char *format, ...);' src/idn2.c.orig > src/idn2.c
    rm src/idn2.c.orig

    echo "" >> src/idn2.c
    echo "static void" >> src/idn2.c
    echo "error (int status, int errnum, const char *format, ...)" >> src/idn2.c
    echo "{" >> src/idn2.c
    echo "  va_list args;" >> src/idn2.c
    echo "  va_start(args, format);" >> src/idn2.c
    echo "  vfprintf(stderr, format, args);" >> src/idn2.c
    echo "  va_end(args);" >> src/idn2.c
    echo "  exit(status);" >> src/idn2.c
    echo "}" >> src/idn2.c
    echo "" >> src/idn2.c
fi

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-ldl" "-lpthread")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build IDN"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** OpenSSL **********"
echo

# wget on Ubuntu 16 cannot validate against Let's Encrypt certificate
wget "https://www.openssl.org/source/$OPENSSL_TAR" --no-check-certificate -O "$OPENSSL_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download OpenSSL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$OPENSSL_DIR" &>/dev/null
tar -xzf "$OPENSSL_TAR"
cd "$OPENSSL_DIR"

# OpenSSL and enable-ec_nistp_64_gcc_128 option
IS_X86_64=$(uname -m 2>&1 | egrep -i -c "(amd64|x86_64)")
if [[ "$SH_KBITS" -eq "32" ]]; then IS_X86_64=0; fi

CONFIG=./config
CONFIG_FLAGS=("no-ssl2" "no-ssl3" "no-comp" "shared" "-DNDEBUG" "-Wl,-rpath,$INSTALL_LIBDIR"
        "--prefix=$INSTALL_PREFIX" "--openssldir=$INSTALL_PREFIX" "--libdir=$INSTALL_LIBDIR_DIR")
if [[ "$IS_X86_64" -eq "1" ]]; then
    CONFIG_FLAGS+=("enable-ec_nistp_64_gcc_128")
fi

KERNEL_BITS="$SH_KBITS" "$CONFIG" "${CONFIG_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure OpenSSL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4 depend)
"$MAKE" "${MAKE_FLAGS[@]}"

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build OpenSSL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install_sw)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** PCRE **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://ftp.pcre.org/pub/pcre/$PCRE_TAR" --no-check-certificate -O "$PCRE_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download PCRE"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$PCRE_DIR" &>/dev/null
tar -xzf "$PCRE_TAR"
cd "$PCRE_DIR"

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-lz" "-ldl" "-lpthread")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --enable-pcregrep-libz --enable-pcregrep-libbz2 \
    --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure PCRE"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4 all)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build PCRE"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** PCRE2 **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://ftp.pcre.org/pub/pcre/$PCRE2_TAR" --no-check-certificate -O "$PCRE2_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download PCRE2"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$PCRE2_DIR" &>/dev/null
tar -xzf "$PCRE2_TAR"
cd "$PCRE2_DIR"

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-lz" "-ldl" "-lpthread")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 \
    --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure PCRE2"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4 all)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build PCRE2"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** cURL **********"
echo

# https://savannah.gnu.org/bugs/?func=detailitem&item_id=26786
wget "https://curl.haxx.se/download/$CURL_TAR" --no-check-certificate -O "$CURL_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download cURL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$CURL_DIR" &>/dev/null
tar -xzf "$CURL_TAR"
cd "$CURL_DIR"

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-lidn2" "-lssl" "-lcrypto" "-lz" "-ldl" "-lpthread")

if [[ ("$IS_SOLARIS" -ne ")" && "$USE_TRUST_STORE" -ne "0") ]]; then
  CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --without-ca-bundle --with-ca-path=/etc/openssl/certs --enable-ipv6 \
    --with-nghttp2 --with-ssl="$INSTALL_PREFIX" \
    --with-libidn2="$INSTALL_PREFIX" --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"
else
  CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-shared --enable-ipv6 --with-nghttp2 --with-ssl="$INSTALL_PREFIX" \
    --with-libidn2="$INSTALL_PREFIX" --prefix="$INSTALL_PREFIX" --libdir="$INSTALL_LIBDIR"
fi

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure cURL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(-j 4)
"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to build cURL"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

MAKE_FLAGS=(install)
if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** Git **********"
echo

# wget on Ubuntu 16 cannot validate against DigiCert certificate
wget "https://github.com/git/git/archive/$GIT_TAR" --no-check-certificate -O "$GIT_TAR"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to download Git"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

rm -rf "$GIT_DIR" &>/dev/null
tar -xzf "$GIT_TAR"
cd "$GIT_DIR"

"$MAKE" configure

if [[ "$?" -ne "0" ]]; then
    echo "Failed to make configure Git"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

# "Instruct Git to use pthread library?", http://stackoverflow.com/q/43080417/
for file in $(find `pwd` -iname 'Makefile*')
do 
    cp "$file" "$file.orig"
    sed 's|-lrt|-lrt -lpthread|g' "$file.orig" > "$file"
    rm "$file.orig"
done

# Various Solaris 11 workarounds
if [[ "$IS_SOLARIS" -eq "1" ]]; then
    for file in $(find `pwd` -iname 'Makefile*')
    do 
        cp "$file" "$file.orig"
        sed 's|-lsocket|-lnsl -lsocket|g' "$file.orig" > "$file"
        cp "$file" "$file.orig"
        sed 's|/usr/ucb/install|install|g' "$file.orig" > "$file"
        rm "$file.orig"
    done
    for file in $(find `pwd` -iname 'config*')
    do 
        cp "$file" "$file.orig"
        sed 's|-lsocket|-lnsl -lsocket|g' "$file.orig" > "$file"
        cp "$file" "$file.orig"
        sed 's|/usr/ucb/install|install|g' "$file.orig" > "$file"
        rm "$file.orig"
    done
fi

if [[ -e /usr/local/bin/perl ]]; then
    SH_PERL=/usr/local/bin/perl
elif [[ -e /usr/bin/perl ]]; then
    SH_PERL=/usr/bin/perl
else
    SH_PERL=perl
fi

SH_LDFLAGS=("$SH_MARCH" "-Wl,-rpath,$INSTALL_LIBDIR" "-L$INSTALL_LIBDIR")
SH_LDLIBS=("-lssl" "-lcrypto" "-lz" "-ldl" "-lpthread")

CPPFLAGS="-I$INSTALL_PREFIX/include -DNDEBUG" CFLAGS="$SH_MARCH" CXXFLAGS="$SH_MARCH" \
    LDFLAGS="${SH_LDFLAGS[@]}" LIBS="${SH_LDLIBS[@]}" \
    ./configure --enable-pthreads --with-lib="$INSTALL_LIBDIR" --with-openssl="$INSTALL_PREFIX" \
    --with-curl="$INSTALL_PREFIX" --with-libpcre="$INSTALL_PREFIX" --with-zlib="$INSTALL_PREFIX" \
    --with-iconv="$INSTALL_PREFIX" --with-perl="$SH_PERL" --prefix="$INSTALL_PREFIX"

if [[ "$?" -ne "0" ]]; then
    echo "Failed to configure Git"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

# See INSTALL for the formats and the requirements
MAKE_FLAGS=(-j 4 all)
if [[ ! -z `which asciidoc 2>/dev/null | grep -v 'no asciidoc'` ]]; then
    if [[ ! -z `which makeinfo 2>/dev/null | grep -v 'no makeinfo'` ]]; then
        MAKE_FLAGS+=("man")
    fi
    if [[ ! -z `which xmlto 2>/dev/null | grep -v 'no xmlto'` ]]; then
        MAKE_FLAGS+=("info" "html")
    fi
fi

"$MAKE" "${MAKE_FLAGS[@]}"

if [[ "$?" -eq "1" ]]; then
    echo "Failed to build Git"
    [[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi

# See INSTALL for the formats and the requirements
MAKE_FLAGS=(install)
if [[ ! -z `which asciidoc 2>/dev/null | grep -v 'no asciidoc'` ]]; then
    if [[ ! -z `which makeinfo 2>/dev/null | grep -v 'no makeinfo'` ]]; then
        MAKE_FLAGS+=("install-man")
    fi
    if [[ ! -z `which xmlto 2>/dev/null | grep -v 'no xmlto'` ]]; then
        MAKE_FLAGS+=("install-info" "install-html")
    fi
fi

if [[ ! (-z "$SUDO_PASSWWORD") ]]; then
    echo "$SUDO_PASSWWORD" | sudo -S "$MAKE" "${MAKE_FLAGS[@]}"
else
    "$MAKE" "${MAKE_FLAGS[@]}"
fi

cd ..

###############################################################################

echo
echo "********** Cleanup **********"
echo

# Set to false to retain artifacts
if true; then

    ARTIFACTS=("$OPENSSL_TAR" "$OPENSSL_DIR" "$UNISTR_TAR" "$UNISTR_DIR" "$READLN_TAR" "$READLN_DIR"
            "$PCRE_TAR" "$PCRE_DIR" "$PCRE2_TAR" "$PCRE2_DIR" "$ZLIB_TAR" "$ZLIB_DIR"  "$BZ2_TAR" "$BZ2_DIR"
            "$IDN2_TAR" "$IDN2_DIR" "$ICONV_TAR" "$ICONV_DIR" "$CURL_TAR" "$CURL_DIR" "$GIT_TAR" "$GIT_DIR")

    for artifact in "${ARTIFACTS[@]}"; do
        rm -rf "$artifact"
    done

    # ./build-git.sh 2>&1 | tee build-git.log
    if [[ -e build-git.log ]]; then
        rm build-git.log
    fi
fi

[[ "$0" = "$BASH_SOURCE" ]] && exit 0 || return 0

경우 당신이 사용하기로 결정sudo암호를 다음 고려 배쉬 기록을 일시적으로 해제 암호가 기록되지 않도록. 기록을 비활성화하여 실수로 민감한 정보를 기록하지 않으므로 문제가되지 않습니다.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.