Use these apt-get commands to swiftly install all available updates for your Ubuntu Linux web server, ensuring optimal performance and security.
sudo apt-get update
This command will download information about all available packages to be updated. You can use this data to perform upgrades or search for details about an update.
sudo apt-get upgrade
This command will install the newest versions of all packages that are currently installed on the system. New packages are installed if required. This will not remove any existing packages.
sudo apt-get full-upgrade
This command will do the function of an upgrade
command and it will also remove any existing packages if required to upgrade the system.
sudo apt-get dist-upgrade
This command will also do the function of an upgrade
command and also intelligently handles changing dependencies with new versions of packages. apt-get
has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if required. The dist-upgrade
command may therefore remove some packages.
Note: You don’t have to use both full-upgrade
and dist-upgrade
as it is not usually needed. You can choose one depending on the requirement.
sudo apt-get autoremove
This command will remove all packages that were automatically installed to satisfy dependencies for other packages and are no longer necessary.
sudo apt-get autoclean
This command will clear out the local repository of retrieved package files that are no longer necessary. This will help maintain a cache from growing out of control over a long period.