Today's Fast and Simple Tip is about apt.
If you use Debian-based distributions and want to update only a specific package, you can use the apt list -u
command to list available updates and then filter the package you want to update.
For example, to update only Chromium:
sudo apt install --only-upgrade $(apt list -u | grep -i chromium | sed 's|/.*||' | xargs) -y
Command Explanation:
-
apt list -u
— Lists packages available for an update. -
grep -i chromium
— Filters only the packages that contain "chromium" in the name. -
sed 's|/.*||'
— Removes the part after the slash (/
), leaving only the package name. -
xargs
— Converts the multi-line output fromsed
into a single line and passes it as arguments toapt install
. -
--only-upgrade
— Ensures that only installed packages are updated. -
-y
— Automatically confirms the update.
This way, you keep your system updated without needing to update everything at once.
Top comments (0)