728x90
도커 실행후 ip link show 명령어를 실행 하려고 하는데 오류가 발생했다.
현상
>> docker run --cap-add NET_ADMIN -it -h node1 --dns 8.8.8.8 --dns-search=example.com ubuntu_net
root@node1:/# ip link show
bash: ip: command not found
ip 명령어가 존재하지 않는 오류가 발생한것으로 관련된 라이브러리를 설치해준다.
이를 해결하기위해 iproute 를 설치하면 되는데 명령어는 아래와 같다
> apt-get install iproute
실행결과 아래와 같은 오류가 또 발생했다.
>> apt-get install iproute
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package iproute is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
iproute2
E: Package 'iproute' has no installation candidate
iproute2 로 재설치를 진행해본다
>> apt-get install iproute2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libatm1 libelf1 libmnl0 libxtables12
Suggested packages:
iproute2-doc
The following NEW packages will be installed:
iproute2 libatm1 libelf1 libmnl0 libxtables12
0 upgraded, 5 newly installed, 0 to remove and 5 not upgraded.
Need to get 828 kB of archives.
After this operation, 2587 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libelf1 amd64 0.170-0.4ubuntu0.1 [44.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmnl0 amd64 1.0.4-2 [12.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 iproute2 amd64 4.15.0-2ubuntu1.3 [721 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libatm1 amd64 1:2.5.1-2build1 [21.9 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxtables12 amd64 1.6.1-2ubuntu2 [27.9 kB]
Fetched 828 kB in 4s (205 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libelf1:amd64.
(Reading database ... 4051 files and directories currently installed.)
Preparing to unpack .../libelf1_0.170-0.4ubuntu0.1_amd64.deb ...
Unpacking libelf1:amd64 (0.170-0.4ubuntu0.1) ...
Selecting previously unselected package libmnl0:amd64.
Preparing to unpack .../libmnl0_1.0.4-2_amd64.deb ...
Unpacking libmnl0:amd64 (1.0.4-2) ...
Selecting previously unselected package iproute2.
Preparing to unpack .../iproute2_4.15.0-2ubuntu1.3_amd64.deb ...
Unpacking iproute2 (4.15.0-2ubuntu1.3) ...
Selecting previously unselected package libatm1:amd64.
Preparing to unpack .../libatm1_1%3a2.5.1-2build1_amd64.deb ...
Unpacking libatm1:amd64 (1:2.5.1-2build1) ...
Selecting previously unselected package libxtables12:amd64.
Preparing to unpack .../libxtables12_1.6.1-2ubuntu2_amd64.deb ...
Unpacking libxtables12:amd64 (1.6.1-2ubuntu2) ...
Setting up libelf1:amd64 (0.170-0.4ubuntu0.1) ...
Setting up libatm1:amd64 (1:2.5.1-2build1) ...
Setting up libxtables12:amd64 (1.6.1-2ubuntu2) ...
Setting up libmnl0:amd64 (1.0.4-2) ...
Setting up iproute2 (4.15.0-2ubuntu1.3) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
다시 ip link show 명령어를 실행해보니 정상적으로 동작하는 것을 확인할 수 있다.
![](https://blog.kakaocdn.net/dn/s5ZFo/btrD5ToVQ7Q/dYbk0n27RUTMReI0KJYcyK/img.png)
반응형