새소식

Knowledge/Base error correction

[Linux]PuTTY 상에서 apt install [something] 에러

  • -

하려던 것.

ssh terminal "Xming"(Ref. 3)을 활용하여 WSL2 즉, Ubuntu환경에 remote접속하고(내 윈도우 데스크탑 컴퓨터의 WSL, Ubuntu) Linux창에서 어떤 apprication실행 시 GUI창을 띄우고 싶다.

https://youtu.be/7wVX-9XkasM?feature=shared 

ssh terminal PuTTY 상에서 WSL2(Ubuntu) 연결하기. (Ref. 1과 함께 따라해보자.)

위 동영상에서 필자는

Session 탭에서 위와 같이 적었으며.

X display location에

:0.0

localhost:0.0

등을 입력하지만(Ref. 3, 4) 필자는 입력하지 않아서 잘 작동했다.

즉, 오히려 입력하면

Gtk-WARNING **: [~]: cannot open display

[~]: 콜론(:)으로 구분된 IP주소와 비슷하게 생긴 주소값. https://youtu.be/-oanqpf0xak?feature=shared&t=121 

를 참조하면 error확인 가능.

 

와 같은 오류가 떴다.

그래서 그냥 안 썼다. -> Enable X11 forwarding은 당연히 체크해줄 것.

Error

apt install gedit

이후에 아래와 같은 에러 메시지가 뜬다.

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Error Correction

(Ref. 2)활용.

Ubuntu 상에서

sudo passwd root

입력하여 비밀번호 설정해 주면 해결된다.

 

Story

*아, sudo 명령어가 잘 안 들어갔나? -> 한 땀 한 땀 정확히 입력 => 같은 Error message

*dpkg 오류인가? 재설치해봐야지 -> (Ref. 6)따라 해 봄. => 같은 Error message

apt install xclock

*다른 사람들은 위처럼 시계 띄우는 걸 예시로 설치하더라.

*왜 PuTTY 옵션에 X display location을 localhost로 하면 오히려 에러가 날까? => 결론 안남.

*(Ref. 5)에서 

User Privilege Lines

The fourth line, which dictates the root user’s sudo privileges, is different from the preceding lines. Let’s take a look at what the different fields mean:

  • root ALL=(ALL:ALL) ALL The first field indicates the username that the rule will apply to (root).
  • root ALL=(ALL:ALL) ALL The first “ALL” indicates that this rule applies to all hosts.
  • root ALL=(ALL:ALL) ALL This “ALL” indicates that the root user can run commands as all users.
  • root ALL=(ALL:ALL) ALL This “ALL” indicates that the root user can run commands as all groups.
  • root ALL=(ALL:ALL) ALL The last “ALL” indicates these rules apply to all commands.

임을 알 수 있다.

 

 

#주의해 주세요.

본 글은 필자의 데스크톱 기준으로 작성되었으며 특정 설정상황에 따라 문제 해결이 되지 않을 수 있습니다.

본 게시판은 필자가 문제를 해결하는 과정을 "단순 메모" 한 것입니다. 공격적인 발언은 자제 부탁드립니다.

질문, 수정 요청은 항상 열려 있습니다. 댓글로 부탁드립니다.^^

 

Reference

1.https://velog.io/@byeol4001/root와-admin-user-그리고-sudo와-su-su-의-차이

 

sudo와 su, su - root 그리고 admin, user 의 차이

배포하는 과정에서, sudo su - root 라는 명령어를 입력하는데,sudo는 알겠는데 root는 왜나오지.. 싶어서 정리 하지 않고선 못넘어 가겠으니오늘의 정리는 이것으로 정했다.😲여러 블로그를 읽고 돌

velog.io

2.https://velog.io/@cbkyeong/ubuntuCould-not-open-lock-file-varlibaptlistslock-Error-해결-방법

 

[ubuntu]Could not open lock file /var/lib/apt/lists/lock Error 해결 방법

오엥 sudo apt update가 안돼요....?

velog.io

3.https://ban2aru.tistory.com/79

 

[윈도우에서 X Window 실행] Xming+putty 연결

X Window란 X Window는 주로 텍스트모드로 사용되는 유닉스/리눅스 운영체제에서 그래픽 인터페이스 환경을 제공해주어서 사용자가 활용하기 편할 수 있도록 해줍니다. X Window는 아래와 같은 서버-

ban2aru.tistory.com

4.https://novice-data.tistory.com/42

 

[클라우드 개발 환경설정 - GUI] 클라우드 서버에 개발 환경 구성 - 어느 Client PC에서나 같은 환경

KT 클라우드를 이용했습니다. 클라우드 서버에 ssh 접속을 위해서 방화벽 오픈 및 접속설정을 해주셔야 합니다. >> 환경구성을 시도한 이유 1. 클라우드 서버에서 golang을 개발하고 싶다. -> 어느 PC

novice-data.tistory.com

5. https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file

 

How To Edit the Sudoers File | DigitalOcean

 

www.digitalocean.com

6. https://investechnews.com/e-unable-to-acquire-the-dpkg-frontend-lock-var-lib-dpkg-lock-frontend-dpkg-lock-%EC%97%90%EB%9F%AC-%ED%95%B4%EA%B2%B0/

 

[ubuntu] 우분투 업데이트 오류 : /var/lib/dpkg/lock-frontend 에러 해결 - 인공지능

E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2813 (apt-get)N: Be aware that removing the lock file is not a solution and may break

investechnews.com

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.