본문 바로가기

리눅스

Ubuntu package offline 설치

반응형

Ubuntu에 package를 offline으로 설치하려면 설치 화일을 받아서 작업을 해야 합니다.

 

우선 설치 화일을 받는 방법 부터 알려드립니다.

 

sudo apt-get install [package]

명령으로 설치되는 패키지의 리스트를 가져와야 합니다.

예를 들어 openssh-server의 경우 입니다.

sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libwrap0 ncurses-term openssh-sftp-server
Suggested packages:
molly-guard monkeysphere ssh-askpass ufw
The following NEW packages will be installed:
libwrap0 ncurses-term openssh-server openssh-sftp-server
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/869 kB of archives.
After this operation, 6806 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

 

위에 보시면 추가로 설치하는 패키지 목록도 보입니다.

"libwrap0 ncurses-term openssh-sftp-server"

 

이제 폴더를 만들고 화일을 다운로드 받습니다.

mkdir openssh

cd openssh

 

sudo apt-get download libwrap0 ncurses-term openssh-server openssh-sftp-server
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libwrap0 amd64 7.6.q-33 [47.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 ncurses-term all 6.4+20240113-1ubuntu2 [275 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 openssh-server amd64 1:9.6p1-3ubuntu13.5 [509 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 openssh-sftp-server amd64 1:9.6p1-3ubuntu13.5 [37.3 kB]
Fetched 869 kB in 3s (335 kB/s)
W: Download is performed unsandboxed as root as file '/home/monster/openssh/libwrap0_7.6.q-33_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

 

마지막 오류는 무시하셔도 됩니다.

화일 목록을 보면 다운 받은 화일들이 있습니다.

ls
libwrap0_7.6.q-33_amd64.deb openssh-server_1%3a9.6p1-3ubuntu13.5_amd64.deb
ncurses-term_6.4+20240113-1ubuntu2_all.deb openssh-sftp-server_1%3a9.6p1-3ubuntu13.5_amd64.deb

 

설치하기 위해서는 다음과 같이 명령어를 입력하면 됩니다.

sudo dpkg -i *.deb
Selecting previously unselected package libwrap0:amd64.
(Reading database ... 54124 files and directories currently installed.)
Preparing to unpack libwrap0_7.6.q-33_amd64.deb ...
Unpacking libwrap0:amd64 (7.6.q-33) ...
Selecting previously unselected package ncurses-term.
Preparing to unpack ncurses-term_6.4+20240113-1ubuntu2_all.deb ...
Unpacking ncurses-term (6.4+20240113-1ubuntu2) ...
Selecting previously unselected package openssh-server.
Preparing to unpack openssh-server_1%3a9.6p1-3ubuntu13.5_amd64.deb ...
Unpacking openssh-server (1:9.6p1-3ubuntu13.5) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack openssh-sftp-server_1%3a9.6p1-3ubuntu13.5_amd64.deb ...
Unpacking openssh-sftp-server (1:9.6p1-3ubuntu13.5) ...
Setting up libwrap0:amd64 (7.6.q-33) ...
Setting up ncurses-term (6.4+20240113-1ubuntu2) ...
Setting up openssh-sftp-server (1:9.6p1-3ubuntu13.5) ...
Setting up openssh-server (1:9.6p1-3ubuntu13.5) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
Processing triggers for man-db (2.12.0-4build2) ...

 

이러면 설치가 완료 됩니다.

 

정리하면

sudo apt-get download [package]

sudo dpkg -i *.deb

입니다.

 

추가 :

목록을 가져와서 다운로드 받는 방법입니다.

apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests \
  --no-conflicts --no-breaks --no-replaces --no-enhances \
  --no-pre-depends openssh-server | grep "^\w")
 

반응형