This is for ubuntu or ubuntu-like systems.


There are times when one may not want to update all the packages

that have updates.  This is especially true for systems that 

have specialized missions for which you need to minimize changes.


Here is one easy way to do this.  The commands below need to be

executed with root privileges.


apt update


# Update only security updates

apt list --upgradable | grep security | cut -d\/ -f1 | xargs apt install -y


# Update only python packages

apt list --upgradable | grep python | cut -d\/ -f1 | xargs apt install -y


# Update only libheif package

apt list --upgradable | grep libheif | cut -d\/ -f1 | xargs apt install -y


# To see just the names of packages that have updates

apt list --upgradable | cut -d\/ -f1


# To see just the names of security packages that have updates

apt list --upgradable | grep security | cut -d\/ -f1