0% found this document useful (0 votes)
107 views

Assignment - 01 Install and Uninstall Software

The document provides instructions on installing and uninstalling software on Ubuntu using package managers like apt and aptitude. It includes commands for updating packages, searching for packages, installing, removing and upgrading packages. It also has exercises for practicing these commands and installing software from source code.

Uploaded by

Thái Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views

Assignment - 01 Install and Uninstall Software

The document provides instructions on installing and uninstalling software on Ubuntu using package managers like apt and aptitude. It includes commands for updating packages, searching for packages, installing, removing and upgrading packages. It also has exercises for practicing these commands and installing software from source code.

Uploaded by

Thái Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

VTI ACADEMY

HỘ CHIẾU LẬP TRÌNH VIÊN DOANH NGHIỆP

System Admin

Training Assignments

Program Code

Issue/Revision x/y

Effective date 04/Aug /2023

VTI ACADEMY
WAY TO ENTERPRISE – CON ĐƯỜNG ĐẾN DOANH NGHIỆP
Training Assignments

Assignment Day 03. Install and Uninstall Software

Mục Lục:

1. Install and Uninstall Software (Ubuntu)


1.1. Tổng hợp các lệnh

command explanation
/etc/apt/sources.list File that contains URL’s to repositories.
/etc/apt/sources.d/ Directory that contains extra repository files.
apt-get update Update the local information with the remote
repositories.
apt-cache search foo Search the repositories for packages with foo in their
name.
apt-get install foo Download and install package foo.
apt-get remove foo Remove (=Uninstall) the package foo.
apt-get purge foo Remove the package foo and all its configuration.
apt-get upgrade Upgrade all installed packages to the latest version
in the repo.
aptitude update Update the local information with the remote
repositories.
aptitude upgrade Upgrade all packages to the latest version.
aptitude search foo Search for all packages with foo in their name.
aptitude install foo Download and install the package foo.
aptitude remove foo Remove the package foo.
aptitude purge foo Remove the package foo and all its configuration.
apt update Update the local information with the remote
repositories.
apt upgrade Upgrade all packages to the latest version.
apt search foo Search for all packages with foo in their name.
apt install foo Download and install the package foo.
apt remove foo Remove the package foo.
apt purge foo Remove the package foo and all its configuration.
dpkg -l foo Display information about package foo.
dpkg -l List all installed and/or configured packages.
dpkg -s foo Display detailed information about package foo.
dpkg -S bar Query to which package the file bar belongs.
dpkg -L foo List all files installed by the package foo.
dpkg -i foo.deb Install the foo.deb package.
dpkg -r foo Uninstall the foo.deb package.

2. Thực hành cài đặt và gỡ cài đặt từ Package Manager

Exercise:

1. Update the meta-information about all packages in the repository to your


server.
2. Download and upgrade all packages on your server to the newest
version.

2
Training Assignments

3. Search for all packages containing the string zfs.


4. Take a backup of /etc/apt/sources.list.
5. Add the contrib packages to /etc/apt/sources.list .
6. Update all repository information, then search for zfs again.
7. Verify with dpkg whether any of the zfs packages are installed.
8. Verify which package installed /bin/mkdir .

Solution:
1. Update the meta-information about all packages in the repository to your
server.
apt update
apt-get update
aptitude update
2. Download and upgrade all packages on your server to the newest
version.
apt-get upgrade
3. Search for all packages containing the string zfs.
aptitude search zfs
4. Take a backup of /etc/apt/sources.list.
cp /etc/apt/sources.list /etc/apt/sources.list.20190914
5. Add the contrib packages to /etc/apt/sources.list .
root@debian10:~# vi /etc/apt/sources.list
root@debian10:~# grep contrib /etc/apt/sources.list
deb http://deb.debian.org/debian/ buster main contrib
deb-src http://deb.debian.org/debian/ buster main contrib
root@debian10:~#
6. Update all repository information, then search for zfs again.
aptitude update
aptitude search zfs # You should see more zfs packages.

7. Verify with dpkg whether any of the zfs packages are installed.
dpkg -l | grep -i zfs
8. Verify which package installed /bin/mkdir .
dpkg -S /bin/mkdir

3. Thực hành cài đặt và gỡ cài đặt từ Source Code

3
Training Assignments

Exercise:
Install netcat utility from source code

Download source:
http://nchc.dl.sourceforge.net/project/netcat/netcat/0.7.1/netcat-0.7.1.tar.gz

Solution:
Download netcat-0.7.1.tar.gz to /tmp directory
cd /tmp
wget http://nchc.dl.sourceforge.net/project/netcat/netcat/0.7.1/netcat-
0.7.1.tar.gz
Extract netcat source code
tar –xvzf netcat-0.7.1.tar.gz
View installation instruction and install netcat
cd ./netcat-0.7.2
less README
less INSTALL
./configure
make
make install
Test netcat after installed
which netcat
netcat -h

You might also like