가끔 크롬 브라우저를 통해 인터넷 검색을 하다 보면, 특정 사이트 페이지에 'http error 400' 오류 문구가 노출되면서, 페이지가 열리지 않을 때가 있습니다. 오늘 이러한 http error 400 오류에 대처하여 해결하는 방법을 간단하게 알려드리니, 참고 바랍니다.

이러한 http error 400 오류는 쉽게 얘기하여, 브라우저 cookie가 충돌을 일으켜서 발생하는 오류인데요. 열림을 원하는 특정 사이트의 누적된 cookie와의 문제로 인해서 발생한 것이기 때문에, 해당 cookie를 삭제하면 해결이 됩니다.

즉, 오늘의 내용은, 크롬 브라우저에서 특정 사이트의 cookie를 지우는 창을 찾아, http error 400 오류를 해결하는 것이 주목적입니다. 해당 크롬 브라우저의 메뉴 위치만 확인하면 해결이 되는 아주 간단한 방법입니다.

http error 400 해결 방법

1. 크롬 브라우저의 설정 메뉴로 이동

  • 크롬 브라우저 우측 상단 모서리에 '전체 메뉴(:)' 클릭
  • 펼침 메뉴에서 '설정' 클릭

 

2. 쿠키 및 기타 사이트 데이터 메뉴 클릭

  • 설정 - '보안 및 개인정보 보호 클릭.
  • 펼침 메뉴에서 '쿠키 및 기타 사이트 데이터' 메뉴 클릭

 

3. '모든 쿠키 및 사이트 데이터 보기' 메뉴 클릭

 

4. 차단된 사이트의 쿠키 선별

  • 우측 검색란에 차단된 '특정 사이트 도메인' 입력 (사진 참조)

 

5. 해당 사이트 쿠키 데이터 삭제

  • 특정 사이트의 모든 쿠키를 삭제하려면 우측 상단 '표시된 항목 모두 삭제'
  • 선택하여 삭제를 원하시면, 쿠키를 선별하여 삭제 가능

 

6. http error 400 문제 해결

  • 크롬 브라우저 주소란에 해당 사이트명 입력 후 접속 확인
  • (저의 경우 tistory.com 페이지가 차단되었었는데요! 해결)

 

이상 http error 400 크롬 브라우저 접속 오류 해결방법에 대한 정보를 정리하여 드렸습니다. 실제 오류를 해결하는데 드는 시간은 1분도 안 걸릴 정도로 매우 간단합니다.

출처 : https://hongejae.tistory.com/entry/http-error-400-%ED%81%AC%EB%A1%AC-%EC%98%A4%EB%A5%98-%EA%B0%84%EB%8B%A8-%ED%95%B4%EA%B2%B0%EB%B0%A9%EB%B2%95

'Works > Network' 카테고리의 다른 글

100Mbps, MB/s로 변환 방법 및 변환한 속도  (0) 2018.04.25
통신사별 DNS 서버 정리  (0) 2017.04.21
서버호스팅 트래픽 계산  (0) 2016.11.08
랜선 만들기 (Direct & Cross Cable)  (0) 2016.07.07

* login shell & non-login shell 이란

/etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bashrc 파일들은 장치 관리 및 사용자 환경을 위한 설정 파일입니다.

위 파일들의 차이점을 알기 위해선 먼저 login shell과 non-login shell을 알아야 합니다.

 ·  login shell : 처음 리눅스를 부팅하고 터미널을 켰을 경우 특정 shell로 접속이 되면 login shell.

 ·  non-login shell : 터미널을 켰을 때 특정 shell로 들어가지 않고 직접 sh 등의 명령어로 특정 shell에 들어가야 할 경우 non-login shell.

=> 예를 들어 새로운 환경변수를 설정할 때 non-login shell 일 경우 .bashrc 파일을 이용해야 합니다.

 

* login shell (profile)

시스템에 로그인하면 login shell로 동작한다고 보면 됩니다. 기본 로그인 쉘인 bash는 login shell로 동작할 때 profile을 읽습니다.

/etc/profile은 /etc/profile.d 디렉토리 안에 존재하는 모든 쉘 스크립트를 실행시는 역할을 합니다.
/etc/profile.d 디렉토리에는 vim, qt, lang, colorls 등 다양한 설정이 sh 파일 형태로 존재하고 최초 로그인 시 /etc/profile을 통해 실행됩니다. (로그인 시 /etc/profile을 먼저 읽고 이후 홈디렉토리의 ~/.profile을 읽음)

 

· 실행 순서

   1. /etc/profile
   2. ~/.bash_profile    or    ~/.bash_login    or    ~/.profile
   3. ~/.bashrc
   4. /etc/bashrc

 

/etc/profile 과 .profile은 shell이 bash 쉘이 아니라도 로그인 시 적용되고, 

.bashrc와 .bash_login, .bash_profile은 bash 쉘로 로그인 되었을 경우만 적용이 됩니다.

리눅스의 기본 로그인 쉘은 bash 쉘로 bashrc는 bash 쉘에서 사용하는 run command 라는 의미를 가집니다. 
사용자가 임의로 로그인 쉘을 변경할 경우 변경한 쉘에 맞는 cshrc, tcshrc, kshrc 파일이 bashrc와 같은 역할을 합니다.

/etc/profile 과 .profile은 shell이 bash가 아니라도 로그인하면 로드되어 적용되고,

.bashrc 와 .bash_login, .bash_profile은 bash shell로 로그인 되었을 경우만 적용이 됩니다.

 

- /etc/profile

: 시스템 전역(모든 사용자)에 대한 환경설정 파일. 로그인시 설정 내용을 읽어들임. 시스템 전반적인 환경값들을 설정.

- ~/.bash_profile

: 개인 사용자에 대한 환경설정 파일. 로그인시 설정 내용을 읽어들임. 각 사용자 환경에 맞는 설정.

 

bashrc 파일을 수정해도 로그인 할 때 반영되는 이유는 /etc/profile이 /etc/bashrc 파일을 읽어오고

~/.profile이 ~/.bashrc 파일을 읽어오도록 구현되어 있기 때문입니다.

=> 환경 설정은 profile 파일에 alias 및 함수 설정은 bashrc 파일 저장하는 것을 권장하고 있습니다.

 

* interactive (rc file)

bash가 아닌 다른 shell에서 bash를 호출할 때 interactive로 동작합니다. 이 때 bash는 rc file을 읽습니다.

bashrc 파일은 bash가 수행될 때 실행되는 함수를 제어하는 지역적인 시스템 설정과 관련된 파일입니다. 

 

- /etc/bashrc

: 시스템 전역(모든 사용자)에 대한 환경설정 파일. 새로운 bash가 실행될 때 마다 내용을 읽어들임.

- ~/.bashrc

: 개인 사용자에 대한 환경설정 파일. bash가 실행될 때 마다 내용을 읽어들임.

 

/etc/profile은 부팅후에 적용되며

~/.bash_profile은 재로그인 하면 적용되나

source 명령어를 이용하여 바로 적용할 수 있습니다.

출처 : https://coding-chobo.tistory.com/72

※ 요약
필자는 간간이 ssh를 이용하고 있고, 가끔 접속 장애가 일어난다. 접속 장애가 일어났을때 매번 찾지 않기 위해 블로그에 정리해둔다. 출처는 땡깡님의 블로그이다.
 
※ 정리
1. 접속 대상이 없을 경우
ssh: connect to host 192.168.0.10 port 22: No route to host
서버가 down 상태이거나 ip 정보가 틀린 경우
 
2. netfilter(iptables)로 막아 놓았을 경우
ssh: connect to host 192.168.0.200 port 22: No route to host
웹서비스는 정상 접속되는 상태에서 ssh 접속이 안되는 경우
 
3. ssh 서비스가 구동중이지 않은 경우
ssh: connect to host 192.168.0.200 port 22: Connection refused
 
4. tcp_wrapper(/etc/hosts.deny)로 막아 놓은 경우
ssh_exchange_identification: Connection closed by remote host
 
5. 서비스 포트가 틀린 경우
ssh: connect to host 192.168.0.200 port 22: Connection refused
 
1번, 2번의 경우 접속 에러 로그는 동일하나 ping test 또는 다른 서비스 접속을 통해 어느 원인인지 확인 가능
3번, 5번의 경우 에러로그 상으로는 파악 불가

출처 : https://shaeod.tistory.com/582

아래와 같은 시스템로그가 계속 발생하는 것은 문제 없는, Info성 메시지이다. 하지만 이 부분이 거슬릴 경우 해당 메시지가 쌓이지 않도록 설정할 수 있다.

 

1. 아래 커맨드 입력을 통해 해당 로그가 쌓이지 않도록 설정해주자.

echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >> /etc/rsyslog.d/ignore-systemd-session-slice.conf

 ( 한줄이다. )

 

2. 설정파일 적용을 위해 rsyslog 재시작을 해주자.

systemctl restart rsyslog

 

출처 : https://growingsaja.tistory.com/217

RockyLinux8 이상에서 부팅시 생성되는 /var/log/dmesg 파일이 존재하지 않는 현상이 있었다.
이를 해결하기 위해 아래 방법을 수행하면 된다.

1) vi /etc/systemd/system/dmesg.service 파일에 아래 내용 추가  (해당 파일은 없으니 만들어야 함)

 [Unit]
 Description=Create /var/log/dmesg on boot
 ConditionPathExists=/var/log/dmesg

 [Service]
 ExecStart=/usr/bin/dmesg
 StandardOutput=file:/var/log/dmesg

 [Install]
 WantedBy=multi-user.target

2) /var/log/dmesg 파일 생성 및 SeLinux 컨텍스트 확인 (Selinux가 비활성화 상태면 dmesg파일만 만들면 된다.)

 # touch /var/log/dmesg
 # restorecon -v /var/log/dmesg (selinux 비활성화면 이 라인은 스킵)

3) 부팅 시 서비스가 시작되도록 활성화

 # systemctl enable dmesg

4) 시스템 재시작 (재부팅 후 /var/log/dmesg 파일 생성 및 파일 내용 확인 할 것)

 #shutdown -r now


참조 : https://www.getpagespeed.com/solutions/the-var-log-dmesg-file-is-not-created-during-boot-for-rocky-linux-8

HTTP 응답 코드 종류

 응답 코드 설명 
100   Continue (클라이언트로 부터 일부 요청을 받았으며 나머지 정보를 계속 요청함)
 101  Switching protocols
 200  OK(요청이 성공적으로 수행되었음)
 201  Created (PUT 메소드에 의해 원격지 서버에 파일 생성됨)
 202  Accepted(웹 서버가 명령 수신함)
 203  Non-authoritative information (서버가 클라이언트 요구 중 일부만 전송)
 204  No content, (사용자 요구 처리하였으나 전송할 데이터가 없음)
 301  Moved permanently (요구한 데이터를 변경된 타 URL에 요청함)
 302  Not temporarily
 304  Not modified (컴퓨터 로컬의 캐시 정보를 이용함, 대개 gif 등은 웹 서버에 요청하지 않음)
 400  Bad request (사용자의 잘못된 요청을 처리할 수 없음)
 401  Unauthorized (인증이 필요한 페이지를 요청한 경우)
 402  Payment required(예약됨)
 403  Forbidden (접근 금지, 디렉터리 리스팅 요청 및 관리자 페이지 접근 등을 차단)
 404  Not found, (요청한 페이지 없음)
 405  Method not allowed (혀용되지 않는 http method 사용함)
 407  Proxy authentication required (프락시 인증 요구됨)
 408  Request timeout (요청 시간 초과)
 410  Gone (영구적으로 사용 금지)
 412  Precondition failed (전체 조건 실패)
 414  Request-URI too long (요청 URL 길이가 긴 경우임)
 500  Internal server error (내부 서버 오류)
 501  Not implemented (웹 서버가 처리할 수 없음)
 503  Service unnailable (서비스 제공 불가)
 504  Gateway timeout (게이트웨이 시간 초과)
 505  HTTP version not supported (해당 http 버전 지원되지 않음)

 

 

HTTP 메소드 종류

 HTTP Method 전송 형태  설명 
 GET GET [request-uri]?query_string
HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n 
 GET 요청 방식은 URI(URL)가 가진 정보를
 검색하기 위해 서버 측에 요청하는형태이다

 

 HTTP Method 전송 형태  설명 
 POST POST [request-uri]?query_string
HTTP/1.1\r\n
HOST:[Hostname] 혹은 [IP] \r\n
Content-Lenght:[Lenght in Bytes] \r\n 
\r\n
[query-string] 혹은 [데이터]
POST 요청 방식은 요청 URI(URL)에
폼 입력을 처리하기 위해 구성한 서버 측 스크립트
(ASP, PHP, JSP 등) 혹은 CGI 프로그램으로
구성되고 Form Action과 함께 전송되는데,
이때 헤더 정보에 포함되지 않고 데이터 부분에 요청 정보가 들어가게 된다.

 

 HTTP Method 전송 형태  설명 
 HEAD HEAD [request-uri] HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n 
HEAD 요청 방식은 GET과 유사한 방식이나 웹 서버에서 헤더 정보 이외에는 어떤 데이터도 보내지 않는다.
웹 서버의 다운 여부 점검(Health Check)이나 웹 서버 정보(버전 등)등을 얻기 위해 사용될 수 있다. 

 

 HTTP Method 전송 형태  설명 
 OPTIONS OPTIONS [request-ri]
HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n 
해당 메소드를 통해 시스템에서 지원되는 메소드 종류를 확인할 수 있다. 

 

 HTTP Method 전송 형태  설명 
 PUT PUT [request-uri] HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n
Content-Lenght:[Length in Bytes] \r\n
Content-Type:[Content Type] \r\n
\r\n
[데이터] 
 POST와 유사한 전송 구조를 가지기 때문에 헤더 이외에 메시지(데이터)가 함께 전송된다.
원격지 서버에 지정한 콘텐츠를 저장하기 위해 사용되며 홈페이지 변조에 많이 악용되고 있다.

 

 HTTP Method 전송 형태  설명 
 DELETE DELETE [request-uri] HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n
\r\n 
 원격지 웹 서버에 파일을 삭제하기 위해 사용되며 PUT과는 반대 개념의 메소드이다.

 

 HTTP Method 전송 형태  설명 
 TRACE TRACE [request-uri] HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n
\r\n 
원격지 서버에 Loopback(루프백) 메시지를 호출하기 위해 사용된다. 

 

 HTTP Method 전송 형태  설명 
 CONNECT CONNECT [request-uri] HTTP/1.1\r\n
Host:[Hostname] 혹은 [IP] \r\n
\r\n 
 웹 서버에 프락시 기능을 요청할 때 사용된다.


출처 : https://gyrfalcon.tistory.com/m/entry/HTTP-%EC%9D%91%EB%8B%B5-%EC%BD%94%EB%93%9C-%EC%A2%85%EB%A5%98-HTTP-%EB%A9%94%EC%86%8C%EB%93%9C-%EC%A2%85%EB%A5%98

Apache 2.4.x 서버에서 mod_cband  (트래픽 사용량 제어 모듈) 설치시 다음과 같은 오류 메세지가 출력됩니다.

[ SUN(11.123) , /usr/local/src/mod-cband-0.9.7.5 ] > make

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c: In function ‘mod_cband_get_dst’:
src/mod_cband.c:1333: error: ‘conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c: In function ‘mod_cband_get_remote_host’:
src/mod_cband.c:1362: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1363: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1365: error: ‘struct conn_rec’ has no member named ‘remote_addr’
apxs:Error: Command failed with rc=65536
.
make: *** [src/.libs/mod_cband.so] 오류 1

mod_cband.c 파일을 편집합니다.

vi /usr/local/src/mod-cband-0.9.7.5/src/mod_cband.c

이때, src/.libs/mod_cband.c 라는 파일이 존재 않은 상태에서 작업해야 합니다.

빨간색은 수정 이전 라인, 파란색은 수정 이후 라인입니다.

1333번 라인
p.add.sin.s_addr = inet_addr(r->connection->remote_ip);
p.add.sin.s_addr = inet_addr(r->connection->client_ip);

1342번 라인
   fprintf(stderr,”%s leaf %s\n”,r->connection->remote_ip,leaf);
   fprintf(stderr,”%s leaf %s\n”,r->connection->client_ip,leaf);

1362~1365번 라인
if (c->remote_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->remote_addr->sa.sin.sin_addr.s_addr;

if (c->client_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->client_addr->sa.sin.sin_addr.s_addr;

위와 같이 수정한 다음 make 명령을 내리면 정상적으로 컴파일이 진행됩니다.

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
/usr/local/apr/build-1/libtool –silent –mode=link gcc -std=gnu99 -o src/mod_cband.la -rpath /usr/local/apache/modules -module -avoid-version src/mod_cband.lo

write “make install” to install module

 

make install

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -i -a -n cband src/mod_cband.la
/usr/local/apache/build/instdso.sh SH_LIBTOOL=’/usr/local/apr/build-1/libtool’ src/mod_cband.la /usr/local/apache/modules
/usr/local/apr/build-1/libtool –mode=install install src/mod_cband.la /usr/local/apache/modules/
libtool: install: install src/.libs/mod_cband.so /usr/local/apache/modules/mod_cband.so
libtool: install: install src/.libs/mod_cband.lai /usr/local/apache/modules/mod_cband.la
libtool: install: install src/.libs/mod_cband.a /usr/local/apache/modules/mod_cband.a
libtool: install: chmod 644 /usr/local/apache/modules/mod_cband.a
libtool: install: ranlib /usr/local/apache/modules/mod_cband.a
libtool: finish: PATH=”/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/java/bin:/root/bin:/sbin” ldconfig -n /usr/local/apache/modules
———————————————————————-
Libraries have been installed in:
/usr/local/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
chmod 755 /usr/local/apache/modules/mod_cband.so
[activating module `cband’ in /usr/local/apache/conf/httpd.conf]

출처 : http://idchowto.com/tip-apache-2-4-x-%EC%84%9C%EB%B2%84%EC%97%90%EC%84%9C-mod_cband-%EC%84%A4%EC%B9%98%EC%8B%9C-%EC%98%A4%EB%A5%98-%EB%A9%94%EC%84%B8%EC%A7%80-%EC%B2%98%EB%A6%AC%EB%B0%A9%EB%B2%95/

 

dpkg 명령어

기본 설명

dpkg는 데비안 패키지 관리 시스템의 기초가 되는 소프트웨어로서, .deb 패키지의 설치, 삭제, 정보 제공을 위해 사용되는 명령어입니다.

dpkg 자체는 APT 등과 같은 고급 도구에 비해 낮은 레벨의 도구이며 복잡한 패키지 관계와 패키지를 원격에서 받아오는 등의 일을 합니다. APT도 Ubuntu의 소프트웨어를 관리하기 위해 내부적으로 이 dpkg를 사용합니다.

 

사용 방법

dpkg -l

: 설치된 패키지 목록 확인 (레드햇 계열 : rpm -qa 와 동일)

 

dpkg -L <패키지명>

: 해당 패키지로부터 설치된 모든 파일목록 확인 (레드햇 계열 : rpm -ql 과 동일)

 

dpkg -C <.deb 파일>

: 해당 .deb 파일이 설치한 파일의 목록 확인

 

dpkg -s <패키지명>

: 해당 패키지에 대한 정보 확인

 

dpkg -I <.deb 파일>

: 해당 .deb 파일에 대한 정보 확인

 

dpkg -S <파일명>

: 해당 파일명 또는 경로가 포함된 패키지들을 검색 (레드햇 계열 : rpm -qf 와 동일)

 

sudo dpkg -i <.deb 파일>

: 해당 파일 설치 또는 최신 버전으로 업그레이드

 

sudo dpkg -r <패키지명>

: 해당 패키지 삭제 (삭제시 설정파일들은 남겨둡니다.)

 

sudo dpkg -P <패키지명>

: 해당 패키지와 해당 패키지의 설정파일을 모두 삭제 (레드햇 계열 : rpm -e 와 동일)

 

sudo dpkg -x <.deb 파일> <디렉토리>

: 파일에 포함되어있는 파일들을 지정된 디렉토리에 압축 해제 (※ 이 명령을 실행할 경우, 해당 디렉토리를 초기화 시켜버리므로 주의해야 합니다!!!!!!!!)

 

 

참고 사이트

http://www.songtory.com/post/001003/1/245

 

http://snowdeer.github.io/linux/2018/02/03/ubuntu-16p04-manage-packages/

 

출처 : https://miiingo.tistory.com/183

'Works > Ubuntu' 카테고리의 다른 글

[명령어] apt remove vs purge 차이  (0) 2022.08.29

 

운영체제 : Ubuntu 18.04

DESCRIPTION

apt-get is the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library. Several "front-end" interfaces exist, such as aptitude(8)synaptic(8) and wajig(1).

 

Unless the -h, or --help option is given, one of the commands below must be present.

remove

remove is identical to install except that packages are removed instead of installed. Note that removing a package leaves its configuration files on the system. If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.

purge

purge is identical to remove except that packages are removed and purged (any configuration files are deleted too).

 

OPTIONS

--purge

Use purge instead of remove for anything that would be removed. An asterisk ("*") will be displayed next to packages which are scheduled to be purged. remove --purge is equivalent to the purge command. Configuration Item: APT::Get::Purge.
 
--auto-remove--autoremove
If the command is either install or remove, then this option acts like running the autoremove command, removing unused dependency packages. Configuration Item: APT::Get::AutomaticRemove.
 

apt 패키지 매니저에서 패키지 삭제 명령어 정리

 

패키지 삭제가 제대로 되지 않아 새롭게 설치하는 패키지에 문제가 생겨 명령어와 옵션에 대해 정리 해보도록 하겠습니다.

 

$ apt remove <패키지명>

패키지를 삭제한다. 하지만 설정파일은 남겨둔다.

$ apt purge <패키지명>

패키지를 삭제한다. 설정파일도 함께 삭제한다.

 

옵션

$ apt [any command] --purge <패키지명>

remove 대신 --purge 명령을 수행한다. remove --purge 는 purge 명령어와 같다,

$ apt remove --auto-remove <패키지명>

사용하지않는 관련된 패키지를 모두 삭제한다.


위는 공식 명령어 가이드와 간략한 해석입니다.

차이는 설정파일을 삭제하느냐 남겨 두느냐의 차이입니다.

 

하지만 purge명령어를 쓰더라도 모든 설정파일을 삭제하는 것은 아닙니다.

user'home 파일은 삭제하지 않습니다.

 

예를들면, /home 폴더 하위에 설정파일을 가지고 있는 어느 어플리케이션 (예를 들면, 크롬 , 파이어폭스 등등..)을 삭제할 때는 /home 디렉터리 내부의 설정파일들은 그대로 남아 있습니다.

 

 

처음에 remove와 remove --auto-remove <패키지명>를 이용해서 패키지를 삭제했는데, 새롭게 설치하는 패키지가 삭제한 패키지와 중첩이 되어 제대로 설치가 되지 않은 문제가 있었습니다.

 

VMware-Tools를 설치하는데 vm-open-tools가 기본적으로 Ubuntu18.04에 설치되어 있어서 먼저 vm-open-tools를 삭제하고 설치를 진행했습니다.

 

remove, --auto-remove 를 사용해 패키지를 지우고

VMware-Tools를 설치하려고하니 이미 open-vm-tools가 설치되어 있어 설치가 정상적으로 되지 않을 수 있다. --purge 옵션을 이용해서 삭제하라는 가이드가 있었습니다.

 

# apt purge open-vm-tools를 이용해 삭제하고 VMware-Tools를 삭제하니 정상적으로 설치, 동작하는 것을 확인하였습니다.

출처: https://gintrie.tistory.com/23 [gintire:티스토리]

'Works > Ubuntu' 카테고리의 다른 글

[Ubuntu] dpkg 명령어 사용법  (0) 2022.08.29
기호 영어 한글
` Backtick(백틱), Grave(그레이브) -
~ Tilde(틸트) 물결표시
! Exclamation mark(엑스클러메이션) 느낌표
? Question mark(퀘스쳔) 물음표
@ At sign(앳) 골뱅이
# Sharp(샵), Number sign(넘버) 우물정
$ Dollar sign(달러) -
% Percent sign(퍼센트) -
^ Caret(캐럿) -
& Ampersand(엠퍼센드) -
* Asterisk(에스터리스크) 별표
- Hyphen(하이픈), Dash(대시), Minus(마이너스) -
_ Underscore(언더스코어), Low dash(로대시) 밑줄
= Equals sign(이퀄) 동등
' Apostrophe(아포스트로피) 작은 따옴표
: Colon(콜론) -
; Semicolon(세미콜론) -
, Comma(콤마) 쉼표
. Period(피리어드), Dot(닷) 점, 마침표
/ Slash(슬래시) -
| Vertical bar(버티컬바) -
\ BackSlash(백슬래시) -
() Parenthesis(퍼렌서시스) 소괄호, 괄호
{} Brace(브레이스) 중괄호
[] Bracket(브래킷) 대괄호
<> Angel Bracket(앵글 브래킷) 꺽쇠괄호

출처 : https://velog.io/@eassi/%ED%8A%B9%EC%88%98-%EB%AC%B8%EC%9E%90-%EC%9A%A9%EC%96%B4-%EC%A0%95%EB%A6%AC