Raspberry Pi_Eng_17.5.2 Installing Programs Distributed in Package Repository


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.5.2  Installing Programs Distributed in Package Repository

 

   "apt-get install" command - install program

 

When installing programs in the package repository, use "install" command in "apt-get" command.

 

[Command Format]

apt-get   [options]   install  <package>

 

[Command Overview]

   This installs the specified package on the system.

   User privilege          -- Super user.

 

[Detail Description]

   When this command is executed, "/etc/apt/sources.list" file used as the source list of the package manager is referenced to find the desired package.

 

[Used Example]

Here we will try to install server program of <TightVNC> program which is used as VNC server at remote connection. As this program is basically a program included in the program list of package manager, you do installation work as follows without special download.

 

pi@raspberrypi ~ $ sudo apt-get install tightvncserver

Reading package lists... Done

Building dependency tree

Reading state information... Done

Suggested packages:

  tightvnc-java

The following NEW packages will be installed:

  tightvncserver

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

Need to get 0 B/786 kB of archives.

After this operation, 1,509 kB of additional disk space will be used.

Selecting previously unselected package tightvncserver.

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

Unpacking tightvncserver (from .../tightvncserver_1.3.9-6.4_armhf.deb) ...

Processing triggers for man-db ...

Setting up tightvncserver (1.3.9-6.4) ...

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

update-alternatives: using /usr/bin/Xtightvnc to provide /usr/bin/Xvnc (Xvnc) in auto mode

update-alternatives: using /usr/bin/tightvncpasswd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode

 

 

   "apt-get --reinstall install" command - reinstall program

 

While the program in the package repository is installed, the program is not installed properly due to a problem and or you need to reinstall it after installation, you can use "--reinstall" option with "install" command to reinstall it.

 

[Command Format]

apt-get   --reinstall    install  <package>

 

[Command Overview]

   This installs the specified package in the system.

   User privilege          -- Super user.

 

[Detail Description]

If you reinstall the program, it has the effect that the existing configuration items for the program will be retained. In this case, the connection password, etc. that was created when you first installed the <TightVNC> server is retained as it was. If you want to remove all these settings and reinstall them, you need to perform the "uninstall program" operation and then install it from scratch.

 

[Main Option]

--reinstall

 

Re-install packages that are already installed and at the newest version. Configuration Item: APT::Get::ReInstall.

 


 

[Used Example]

The following is a command to reinstalls the <TightVNC> server program.

 

pi@raspberrypi ~ $ sudo apt-get --reinstall  install  tightvncserver

Reading package lists... Done

Building dependency tree

Reading state information... Done

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

Need to get 0 B/786 kB of archives.

After this operation, 0 B of additional disk space will be used.

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

Preparing to replace tightvncserver 1.3.9-6.4 (using .../tightvncserver_1.3.9-6.4_armhf.deb) ...

Unpacking replacement tightvncserver ...

Processing triggers for man-db ...

Setting up tightvncserver (1.3.9-6.4) ...