I have the latest version of Ubuntu Linux LTS server. How do I update Ubuntu Linux for security and application fix/upgrades using ssh command line? How can I install updates via command line option?
Ubuntu Linux server – Install updates via apt-get command line
The commands are as follows:
- apt-get update: Update is used to resynchronize the package index files from their sources on Ubuntu Linux via the Internet.
- apt-get upgrade: Upgrade is used to install the newest versions of all packages currently installed on the Ubuntu system.
- apt-get install package-name: Install is followed by one or more packages desired for installation. If package is already installed it will try to update to latest version.
First, open the Terminal application and type following two commands (Application > Accessories > Terminal).
Get updated software list for Ubuntu, enter:
$ sudo apt-get update
$ sudo apt-get upgrade
Please note that above two commands will fetch files from the Internets or local mirrors. The location of update pages is specified in /etc/apt/sources.list (repositories). You need NOT make any changes to this file until and unless you need extra repositories for your setup.
INSTALL KERNEL UPDATES ON A UBUNTU LTS SERVER
Type the following apt-get command:
$ sudo apt-get dist-upgrade
The dist-upgrade in addition to performing the function of upgrade, 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 necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files.