1

To me it seems like needless hassel for the lay user but I assume there must be some advantage over just automatically updating the repository when the user wants to upgrade.

0x777C
  • 480
  • 1
    It saves resources. If I update, install a program then perform upgrade - your method would cause the update to occur twice in that circumstance wasting cpu, energy & bandwidth. As a user you may not care thinking because it took you an extra second to type the sudo apt update; , but in an automated environment there is no second saved, and that process can occur multiple times. This is only one advantage. – guiverc Aug 06 '18 at 13:47
  • There's no advantage, that's just how package managers with remote repository support work: get list of items available in remote repo first, then upgrade what's possible. – Sergiy Kolodyazhnyy Aug 06 '18 at 13:50
  • There are package managers and wrappers for package managers (like Termux's pkg) that do updating automatically, hence when I'm asking. – 0x777C Aug 06 '18 at 14:01
  • "advantage" I suppose would be an opinion, it is just the way apt / apt-get have always worked. It gives Debian / Ubuntu character – Panther Aug 06 '18 at 14:17

1 Answers1

2

update is separated by upgrade, because upgrade is not the only command you can run on an updated local package index.

  • apt upgrade: upgrade all packages
  • apt list: lists all packages with search name, supports glob
  • apt search: searches packages with search name or description, supports regex
  • apt show: shows information on a package
  • apt policy: shows installation policy for a package

Combining these commands with update would be very inefficient. For todays desktop user with high-speed internet it seems to be obsolete. But for a sysadmin or some scripted solutions this is still relevant.


As a simple "workaround" you could add a function aptup to your bashrc:

echo 'aptup () { sudo apt update && sudo apt -y upgrade; }' >> ~/.bashrc
source ~/.bashrc

(Remove the -y if you want to be asked for confirmation before upgrading).

Then you can run aptup to update and upgrade the system.

pLumo
  • 26,947