표준 시스템 유틸리티가 설치되지 않았고 $PATH에 c 컴파일러가 없는 경우 데비안 9 빌드 필수를 오프라인으로 설치하는 방법

표준 시스템 유틸리티가 설치되지 않았고 $PATH에 c 컴파일러가 없는 경우 데비안 9 빌드 필수를 오프라인으로 설치하는 방법

나는 표준 시스템 유틸리티를 사용하지 않고 공식 DVD #1에서 데비안을 설치했고, 오프라인 설치를 위해 빌드 필수 세트를 계속 사용하고 싶습니다. 내 시스템의 $PATH에 C 컴파일러가 없고 다른 Linux 장치도 없는 경우 C 컴파일러를 오프라인으로 어떻게 설치합니까?

답변1

저장소와 같은 공용 컴퓨터를 찾아 데비안 사이트에서 패키지를 다운로드하고 모든 종속성을 찾아보세요.

http://deb.debian.org/debian/pool/main/b/build-essential/build-essential_12.3.tar.gz

확인하다:

https://packages.debian.org/source/stretch/build-essential

시스템에 인터넷과 Debian 또는 Ubuntu가 설치되어 있거나 VM(VirtualBox는 Windows에서 실행됨)에 설치되어 있는 경우 해당 시스템에 종속된 패키지를 가져옵니다.

# aptitude clean
# aptitude --download-only install <your_package_here>
# cp /var/cache/apt/archives/*.deb <your_directory_here>

https://stackoverflow.com/questions/13756800/how-to-download-all-dependent-and-packages-to-directory/39968534

또는

apt-rdependents를 사용하여 기본 패키지를 포함한 전체 종속성 세트를 (재귀적으로) 빌드한 후 다음을 다운로드할 수 있습니다.

apt-get download $(apt-rdepends "${package}" | grep -v ^\ )

(물론 "${package}"를 교체하십시오).

적성을 사용하여 패키지와 해당 종속성을 다운로드하는 방법은 무엇입니까?

그런 다음 USB 스틱을 사용하여 파일을 오프라인 서버에 복사합니다.

cp -R /mnt/USBstick/* /root/packeges && cd /root/packages

설치 방법에는 여러 가지가 있습니다. 그 중 하나는 다음과 같습니다.

dpkg -i <deb file>

종속성이 필요하다는 말은 실패합니다. 나중에 apt-get update를 수행하면 "종속성을 설치할 준비가 되었습니다"와 같은 메시지가 표시되며 이를 사용하는 것이 좋습니다.

apt-get install -f

완료되면 사용합니다.

dpkg -i

다시.

depends편집: 빌드에는 다음이 필요합니다 .

[21:33:49][root] /home/USER [HOST]
~↓↓$↓↓ apt-cache depends build-essential
build-essential
 |Depends: libc6-dev
  Depends: <libc-dev>
    libc6-dev
  Depends: gcc
  Depends: g++
  Depends: make
    make-guile
  Depends: dpkg-dev

답변2

ivan@darkstar:~$ cat /usr/share/doc/build-essential/list 
                   List of Build-Essential packages
                    as of 2017-09-17, Debian sid

This file lists the non-essential packages that are build-essential.
The list is not closed under the "depends on" relation, so one will
usually need to install more packages than given here.

This list attempts to document the set of build-essential packages as
well as possible.  However, it is not authoritative (actually, there
is no authoritative list at all); the definition of the
"build-essential" class of packages given in Debian Policy Manual
(version >= 3.6.1.1), section 4 "Source packages" (more precisely
subsection 4.2 "Package relationships") is the definitive answer.
Here's the definition (as of Policy 3.6.1.1):

    It is not necessary to explicitly specify build-time relationships
    on a minimal set of packages that are always needed to compile,
    link and put in a Debian package a standard "Hello World!" program
    written in C or C++.  The required packages are called
    _build-essential_, and an informational list can be found in
    `/usr/share/doc/build-essential/list' (which is contained in the
    `build-essential' package).

The list is given below in a format which is readable by both humans and
programs.  The format is described at the end of this file.

BEGIN LIST OF PACKAGES
libc6-dev [!alpha !ia64 !hurd-i386] | libc0.3-dev [hurd-i386] | libc6.1-dev [alpha ia64] | libc-dev
  Provides the ISO C standard library
  Indirectly depended on by g++, but we'll ignore
  it since libc6-dev is used for non-C++ programs too.

libc6-dev-sparc64 [sparc]
  Used only on the sparc architecture.

gcc (>= 4:7.2)
g++ (>= 4:7.2)

  NOTE:
  The libstdc++ -dev library is not needed, as g++ depends on it

make
  Also depended on by dpkg-dev, but make does warrant its own
  dependency since debian/rules will need it even if dpkg-dev
  stopped depending on it

dpkg-dev (>= 1.17.11)
  Provides dpkg-genchanges and other scripts.  Versioned, because
  of support for the build-time dependency fields in /debian/control
  and dpkg-architecture support for OS and CPU information.

  NOTE:
  Although this list does not contain them, all `Essential: yes'
  packages are build-essential as well.  A list of such packages
  can be found by executing the following command
     `grep-status -FEssential -sPackage -ni yes'
  when the `grep-dctrl' package is installed and in its default
  configuration.  Such list is installed with this package as
  the file
     `/usr/share/doc/build-essential/essential-packages-list'

hurd-dev [hurd-i386]
  Provides libpthread.so (and other such essential components).

END LIST OF PACKAGES

Here's the format definition:

   - First line is the following, without any leading or trailing
     whitespace:
        BEGIN LIST OF PACKAGES

   - Last line is the following, without any leading or trailing
     whitespace:
        END LIST OF PACKAGES

   - A line with leading whitespace is a comment.

   - Other lines are joined with end-of-line replaced by comma, and
     the result is parsed like the body of the Build-Depends field.
     The list of build-essential packages for a particular
     architecture is constructed from the result list by ignoring all
     the package name - package version pairs which would be ignored
     if we were building for that architecture and then removing the
     architecture specifications.

관련 정보