Demonstrates how to management various tasks with Apt
More apt examples 35_apt_and_dpkg
NOTE: This is very ubuntu flavoured.
TODO:
- Pinning version
- Patching.
# root shell
sudo su
# update apt cache
apt update
# show packages that can be upgraded
apt list --upgradable
dist-upgrade
Sometimes the version of the distro does not have the latest kernel features. This can be addressed by installing the HWE version.
# kernel upgrades with hwe
sudo apt-get install --install-recommends linux-generic-hwe-18.04
Sometimes apt update
will fail with key or tls failures
# apt update failures
sudo apt update
# show lists
ls -l /var/lib/apt/lists
# you can remove the lists but they will be recreated if you still have sources
rm /var/lib/apt/lists/*
# remove repositories list (target the removal to packages that are failing)
ls -l /etc/apt/sources.list
ls -l /etc/apt/sources.list.d
# removes line from sources
sudo add-apt-repository -r "line entry in sources.list"
# stop trusting keys
sudo apt-key del <keyid>
# add src sources
sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt update
# make and install
apt-get source git
./configure --prefix=$HOME/myapps
make
make install
- How to install program locally without sudo privileges? here