Читать книгу Mastering Linux System Administration - Richard Blum - Страница 59

Real World Scenario INSTALLING SOFTWARE USING APT

Оглавление

Using the apt command makes installing software in Ubuntu easy. In this exercise, you'll install the Z shell on your Ubuntu server.

1 Log into your Linux system as the sysadmin account created in Chapter 2, “Installing an Ubuntu Server.”

2 From the command prompt, enter the command sudo apt install zsh. The sudo command is required to allow your user to run the apt command with root user privileges. Enter your user password when prompted. You should see something similar to this output: [sudo] password for sysadmin: Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: zsh-common Suggested packages: zsh-doc The following NEW packages will be installed: zsh zsh-common 0 upgraded, 2 newly installed, 0 to remove and 56 not upgraded. Need to get 4,450 kB of archives. After this operation, 18.0 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 zsh-common all 5.8-3ubuntu1 [3,744 kB] Get:2 http://us.archive.ubuntu.com/ubuntu focal/main amd64 zsh amd64 5.8-3ubuntu1 [707 kB] Fetched 4,450 kB in 4s (1,039 kB/s) Selecting previously unselected package zsh-common. (Reading database … 179515 files and directories currently installed.) Preparing to unpack …/zsh-common_5.8-3ubuntu1_all.deb … Unpacking zsh-common (5.8-3ubuntu1) … Selecting previously unselected package zsh. Preparing to unpack …/zsh_5.8-3ubuntu1_amd64.deb … Unpacking zsh (5.8-3ubuntu1) … Setting up zsh-common (5.8-3ubuntu1) … Setting up zsh (5.8-3ubuntu1) … Processing triggers for man-db (2.9.1-1) … $

3 Test the install by entering the command zsh. You will see a menu prompting if you want to customize your Z shell environment. Enter 0 to use the default configuration. You should then get the Z shell prompt. ubuntu-server%

4 Return to your normal Bash Shell by typing the command exit.

5 Check whether the installation processed properly, type the command apt ‐‐installed list. You should see the package appear, indicating that it is installed.

When installing a package, apt will ask to install other packages as well. This is because apt automatically resolves any necessary package dependencies for us and installs the needed additional library and software packages. This is a wonderful feature included in many package management systems.

Mastering Linux System Administration

Подняться наверх