Assignment - 01 Install and Uninstall Software
Assignment - 01 Install and Uninstall Software
System Admin
Training Assignments
Program Code
Issue/Revision x/y
VTI ACADEMY
WAY TO ENTERPRISE – CON ĐƯỜNG ĐẾN DOANH NGHIỆP
Training Assignments
Mục Lục:
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.
Exercise:
2
Training Assignments
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
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