Raspberry Pi_Eng_17.6.1 Uninstalling Programs


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


17.6   Uninstalling Programs and Cleaning Files

 

17.6.1  Uninstalling Programs

 

If you no longer need the installed programs, you should remove them. There are several ways to remove installed programs.

 

17.6.1.1    "apt-get remove" Command

 

You can use "remove" command in "apt-get" command to remove the programs installed on your system but keep the configuration settings intact.

 

[Command Format]

apt-get   remove  <package>

 

[Command Overview]

   This removes installed packages

   User privilege          -- Super user.

 

[Detail Description]

   The packages installed on the system are removed, but the existing configuration files remain intact.

   To do the same thing using "dpkg command", use the following command.

dpkg -r, --remove package ...

 

[Used Example]

The following is an example of deleting a previously installed <TightVNC> server package.

 

pi@raspberrypi:~ $ sudo apt-get remove tightvncserver

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages will be REMOVED:

  tightvncserver

0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.

After this operation, 1,416 kB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 118839 files and directories currently installed.)

Removing tightvncserver (1.3.9-6.5) ...

update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode

Processing triggers for man-db (2.7.0.2-5) ...

 

 


 

17.6.1.2    "apt-get purge" Command

 

You can use "purge" command in "apt-get" command if you want to delete all programs and configuration for the programs installed on your system.

 

[Command Format]

apt-get   purge   <package>

 

[Command Overview]

   This removes installed packages and config files

   User privilege          -- Super user.

 

[Detail Description]

   The "purge" command is basically the same as "remove" and all configuration files are removed.

   To do the same thing using the "dpkg" command, use the following command.

dpkg -P, --purge package...

 

[Used Example]

The following is an example of deleting a previously installed <TightVNC> server package.

 

pi@raspberrypi:~ $ sudo apt-get purge tightvncserver

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages will be REMOVED:

  tightvncserver*

0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.

After this operation, 1,416 kB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 118839 files and directories currently installed.)

Removing tightvncserver (1.3.9-6.5) ...

update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode

Processing triggers for man-db (2.7.0.2-5) ...

 


 

17.6.1.3    "apt-get autoremove" Command

 

Among the program package installed in the system, there is also a program package installed by the system administrator for real use, but there may also be a program package installed automatically internally since it is needed when executing another program package. However, if another package using the automatically installed package is deleted and is no longer used, the automatically installed program package should be removed.

 

You can use "autoremove" command in "apt-get" command to remove any of the automatically installed program packages that is no longer used.

 

[Command Format]

apt-get   autoremove  

 

[Command Overview]

   This automatically removes unused packages.

   User privilege          -- Super user.

 

[Detail Description]

The "autoremove" command removes any packages that have been automatically installed to satisfy dependencies when installing other packages, but are no longer needed because the circumstances change later.

 

[Used Example]

The following is an example of running a command to remove an obsolete installed program packages from the system.

 

pi@raspberrypi:~ $ sudo apt-get autoremove

Reading package lists... Done

Building dependency tree

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.