• 카테고리

    질문 & 답변
  • 세부 분야

    반도체

  • 해결 여부

    해결됨

apt install 시 connecting error 문제

21.05.04 13:34 작성 조회수 5.42k

3

맛비님 안녕하세요, 이제 막 수강 시작한 막학기 학부생입니다.

[Hello World 프로그램] 강좌에서 gedit 설치 시도하는 부분에서 해결 못하고 있는 에러가 있어서 문의 남깁니다.

sudo apt install gedit

실행했을 때, 설치가 진행되는 듯 하다가

[Connecting to archive.ubuntu.com]에서 진행이 막히고 아래와 같이 Error가 반복적으로 뜹니다.

구글링을 통해 해결해보려 했으나,

많은 사이트에서 반복적으로 확인되는 해결법 중

위 방법과,

위 두 방법 모두 해결이 되지 않아서요..

앞으로 공부하려면 이정도는 스스로 해결해나갈 수 있어야 할텐데, 부끄럽지만서도 혹 간단한 해결책이 있을까 하여 문의 드려봅니다.

감사합니다.

답변 1

답변을 작성해보세요.

1

안녕하세요. :)

확인 했구요. 회사 컴이 ubuntu 가 아니라서 재현을 못하겠네요.

발생한 에러 메세지로 구글링을 해보니

해당 우분투 서버에 등록된 DNS 에서 kr.archive.ubuntu.com 를 찾을 수가 없는상황.  이라고 검색이 되네요.

집에가서 제 머신에서 확인해볼께요.

한가지 확인해 보실께,  다음 명령어를 치셔서 나오는 화면을 올려주시면 답변에 도움이 될 것 같아요.

cat /etc/resolv.conf  

다음은 제가 확인한 link 에요.

http://1004lucifer.blogspot.com/2018/01/ubuntu-temporary-failure-resolving.html

Wamelshu님의 프로필

Wamelshu

질문자

2021.05.04

네 해당 상황이 맞는 것 같습니다.

링크주신 도움에서와 같이 nameserver 추가하고 나서,

cat /etc/resolv.conf

명령어 입력하고 나면, 나오는 화면 위와 같습니다.

Wamelshu님의 프로필

Wamelshu

질문자

2021.05.04

interfaces에서 아래와 같이 dns 추가

아래와 같이, nameserver 추가

이 때, 위 답변에 적어주신 cat / 이하 명령어 입력 시

위와 같은 결과 화면 출력됩니다.

추가적으로 언급된 해결책 중 서버주소를 바꾸어주는 방법을 아래와 같이 실행하였는데,

connecting에 문제가 있었던 서버 주소

archive.ubuntu.com

security.ubuntu.com 주소 모두 아래 보이듯,

mirror.kakao.com 으로 바꾸어 주었습니다. (빨간 글씨 해당)

 https://webdir.tistory.com/201 여기서 참고가능한 것과 같이

vi의 치환기능이 사용되지 않아 일일이 주소를 새로 써주었고,

이 때, vi에서 저장하고 나가려고 하니(:wq 입력 시) sources.list 파일?(폴더?) 가 readonly라는 오류(E212 혹은 E45)가 반복적으로 뜨기에..(' read only option is set add to override..')

https://stackoverflow.com/questions/8253362/etc-apt-sources-list-e212-cant-open-file-for-writing/16585073

위 사이트에 참고한, 위 명령어 입력하여 강제로 입력 후 vi 닫아주었습니다.

이후, 기존에 sudo apt install gedit 명령어 입력했을 때 아래처럼

71% 까지는 진행되었던 과정이, 이제는 아예 아래와 같이 package loading을 못하고 있는 것 같습니다.

이제 더 이상 어떻게 시도해봐야 할 지 몰라서 상황설명과 함께 도움 부탁드립니다. 몹시 초보적인 질문인 것은 알고 있으나,

코딩은 물론 ubuntu와 같은 리눅스 환경이 처음인지라 시행착오가 많습니다.

문의글 내용이 다소 내용이 길지만,, 혹시나 쉬운 해결법을 아신다면 도움 부탁드립니다. 

Wamelshu님의 프로필

Wamelshu

질문자

2021.05.04

참고로 readonly 문제에서 :w! 와 같이 간단하게 해결되지 않아 위 명령어 입력하였습니다.

엄청 많은 것을 트라이 해보셨군요. 리눅스하고 친해지는 과정이라고 생각하시면 좋을 것 같습니다. (긍정긍정)

아직 회사인지라, 현상만 보면

다음은 root 계정이 아닌 일반 계정으로 해당 파일을 편집하셔서 발생하는 권한문제이구요. 만약에 root 계정이셨다면 정상적으로 wq 로 저장 되셨을꺼에요.

알려주신 파일들을 제꺼를 캡쳐해서 공유드리도록 하겠습니다.

밤에 할꺼라, 내일중에 확인해보세요. :)

안녕하세요. :)

우선 제 머신은 잘되는 것 같습니다. 일단 지웠다가 다시 설치 해봤구요.

제꺼하고 동일한지 한번 봐주세요. 안되시면, 어떻게 안되는지 계속 댓글 주세요. 같이 해결해 보아요.

참고로 저의 WSL 의 우분투 버전은 

이제 몇가지 부분을 공유드릴께요.

1. /etc/resolv.conf

2. /etc/network/interfaces (이 파일은 제 머신에서는 존재하지 않습니다.)

3. /etc/apt/sources.list  (이거는 혹시 모르니 전부를 공유드립니다. 복 붙해서 써보세요. 해당 파일을 수정하실때는 sudo 를 앞에 붙여서 해주세요. 그래야 wq 로 저장이 될꺼에요. root 권한입니다.)

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://archive.ubuntu.com/ubuntu/ focal main restricted

# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the

## distribution.

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted

# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team. Also, please note that software in universe WILL NOT receive any

## review or updates from the Ubuntu security team.

deb http://archive.ubuntu.com/ubuntu/ focal universe

# deb-src http://archive.ubuntu.com/ubuntu/ focal universe

deb http://archive.ubuntu.com/ubuntu/ focal-updates universe

# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://archive.ubuntu.com/ubuntu/ focal multiverse

# deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse

# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

# deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's

## 'partner' repository.

## This software is not part of Ubuntu, but is offered by Canonical and the

## respective vendors as a service to Ubuntu users.

# deb http://archive.canonical.com/ubuntu focal partner

# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted

# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted

deb http://security.ubuntu.com/ubuntu/ focal-security universe

# deb-src http://security.ubuntu.com/ubuntu/ focal-security universe

deb http://security.ubuntu.com/ubuntu/ focal-security multiverse

# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse

Wamelshu님의 프로필

Wamelshu

질문자

2021.05.06

감사합니다^^
한 줄, 한 줄 비교하면서 입력했더니 잘 해결되었습니다.

덕분에 배워가는 재미 느끼면서 우분투와 친해지고 있습니다.

빠른 답변 정말 감사합니다!

앗! 해결 되셨다니 다행입니다. :)

설계 엔지니어가 목표시라면, Linux 환경도 친해지면 (아주 많이) 좋구요.

이번기회에 gedit 이 아닌 vim 을 마스터 해보시는 것도..? 

(필수는 아니에요. 하지만! Veirlog HDL 이 코드 라인 수가 상대적으로 길어서;; 번잡한 단순 노동을 필요로 할 때가 있어요. Vim 기능에 익숙해 지시면 빠르고 정확한 단순노동을 해결할 수 있습니다.)

그럼 즐공하세요 :)