security/B. Linux Server

[Trouble Shooting] E: Unable to locate package (해결)

xudegloss 2024. 3. 13. 23:49

1) ubuntu-server 24.04.4 lts 설치

## profile setup ##
1) name : xudegloss
2) server name : xudeglossserver
3) username : nojeans
4) password

# [username]@[server name]
## 고정 설정 ##
1) IP : 192.168.111.129
2) GW : 192.168.111.2
3) search domain : 168.126.63.1 
4) name-server : 8.8.8.8
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-100-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.
Last login: Wed Mar 13 14:57:55 2024
/usr/bin/xauth:  file /home/nojeans/.Xauthority does not exist
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

nojeans@xudeglossserver:~$ 
# [username]@[server name]


nojeans@xudeglossserver:~$ sudo su
[sudo] password for nojeans:

root@xudeglossserver:/home/nojeans# hostname
xudeglossserver # [server name]

root@xudeglossserver:/home/nojeans# whoami
root # 현재 접속하고 있는 사용자 → 관리자

 

2) sudo apt-get install vim

root@xudeglossserver:/home/nojeans# sudo apt-get install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libgpm2 libpython3.10 libsodium23 vim-common vim-runtime
Suggested packages:
  gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
  libgpm2 libpython3.10 libsodium23 vim vim-common vim-runtime
0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 44.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
...

 

3) E: Unable to locate iputils 

root@xudeglossserver:/home/nojeans# sudo apt-get install iputils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package iputils

 

1) 제일 먼저 확인해야 하는 부분은 찾고 있는 패키지가 해당 ubuntu 버전에서 사용할 수 있는지 체크 必

root@xudeglossserver:/home/nojeans# lsb_release -a
root@xudeglossserver:/home/nojeans# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

 

2) 해당 버전에 맞는 패키지 이름 검색

  • Keyword → 패키지 이름 검색
  • Distribution → Codename 입력

 

 

3) 해당 패키지 이름으로 설치 진행

root@xudeglossserver:/home/nojeans# ping 8.8.8.8
bash: ping: command not found

root@xudeglossserver:/home/nojeans# sudo apt-get install iputils-ping
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  iputils-ping
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 42.9 kB of archives.
After this operation, 116 kB of additional disk space will be used.
Get:1 http://kr.archive.ubuntu.com/ubuntu jammy/main amd64 iputils-ping amd64 3:20211215-1 [42.9 kB]
Fetched 42.9 kB in 1s (51.3 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package iputils-ping.
(Reading database ... 66137 files and directories currently installed.)
Preparing to unpack .../iputils-ping_3%3a20211215-1_amd64.deb ...
Unpacking iputils-ping (3:20211215-1) ...
Setting up iputils-ping (3:20211215-1) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)
debconf: falling back to frontend: Readline
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@xudeglossserver:/home/nojeans# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=30.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=31.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=30.8 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=31.5 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=128 time=30.2 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=128 time=29.8 ms
^C
--- 8.8.8.8 ping statistics ---

 

4) 참고 자료

https://operavps.com/docs/fix-unable-to-locate-package-error-on-ubuntu/
https://integer-ji.tistory.com/370

 

5) Snapshot

 

Snapshot manager → Go To → 원복 가능