apt: just update this

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 from sed into a single line and passes it as arguments to apt 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.

Feb 6, 2025 - 19:27
 0
apt: just update this

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:

  1. apt list -u — Lists packages available for an update.
  2. grep -i chromium — Filters only the packages that contain "chromium" in the name.
  3. sed 's|/.*||' — Removes the part after the slash (/), leaving only the package name.
  4. xargs — Converts the multi-line output from sed into a single line and passes it as arguments to apt install.
  5. --only-upgrade — Ensures that only installed packages are updated.
  6. -y — Automatically confirms the update.

This way, you keep your system updated without needing to update everything at once.