Linux+ 2.4.2: Repositories and other sources
An extra repository, alternatives, a Python virtual environment, and building a small program from source.
Before you start
Work as root, so ~ is /root. The VM needs internet access. The lab
sets the editor alternative to automatic mode (on Debian and Ubuntu) and
checks that ~/venv and ~/src don't exist yet. Leave your work in
place for grading.
Tasks
- RHEL relatives: add the EPEL repository, enable the CRB repository, and
install
htopfrom EPEL. - Debian and Ubuntu: look at the APT sources and the alternatives for
editor, then choose an editor yourself withupdate-alternatives --config editor. - See what
pip3 installdoes outside a virtual environment, then create the virtual environment~/venvand installrequestsinto it. - In
~/src, writehi.c(a program that printsbuilt) and aMakefilewith ahitarget that compiles it and aninstalltarget that copies it to/usr/local/bin/hi. Build it, install it, and runhi.
Hints
dnf repolist --all,dnf install epel-release,dnf config-manager --set-enabled crb,dnf list --installed htop(the repo column).cat /etc/apt/sources.list.d/*.sources,update-alternatives --display editor.- Ubuntu needs
python3-venv(andpython3-pip);python3 -m venv,~/venv/bin/pip install,~/venv/bin/pip list. gccandmake(build-essentialon Ubuntu); Makefile recipe lines start with a tab.