martes, 11 de septiembre de 2018

Cómo actualizar Ubuntu



Cómo actualizar el software instalado en un sistema operativo Ubuntu (o cualquiera de sus derivados) para aplicar parches a los programas y manetener el sistema al día.



Mantener el software de un sistema operativo al día - incluyendo sus componentes base - es una tarea básica de cualqueir administrador de sistemas. En el caso de Ubuntu (o Debian, Linux Mint, etc.) el gestor de paquetes que nos permite actualizar las versiones de los mismos es apt.

Para iniciar el proceso de actualización, usaremos el comando apt update (recordar que si usamos Ubuntu, debemos poner el comando sudo delante de cada comando para ejecutarlo como root):

usuario@host:~$ sudo apt update [sudo] password for usuario: Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB] Hit:2 http://es.archive.ubuntu.com/ubuntu bionic InRelease Get:3 http://es.archive.ubuntu.com/ubuntu bionic-updates InRelease [83.2 kB] Get:4 http://es.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] ... Fetched 1,005 kB in 1s (937 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 5 packages can be upgraded. Run 'apt list --upgradable' to see them.

La opción update compara las versiones del software instaladas en local con las versiones del mismo software disponibles en los distintos repositorios del sistema operativo.

Para ver las nuevas versiones de cada programa que podemos instalar deberemos ejecutar apt list --upgradable (deberemos ejecutar esta opción solo después de haber ejecutado apt update). Este comando listará cada paquete y su nuevo número de versión disponible.

usuario@host:~$ apt list --upgradable Listing... Done libssl1.0.0/bionic-updates,bionic-security 1.0.2n-1ubuntu5.1 amd64 [upgradable from: 1.0.2n-1ubuntu5] libssl1.1/bionic-updates,bionic-security 1.1.0g-2ubuntu4.1 amd64 [upgradable from: 1.1.0g-2ubuntu4] networkd-dispatcher/bionic-updates,bionic-updates 1.7-0ubuntu3.2 all [upgradable from: 1.7-0ubuntu3] openssl/bionic-updates,bionic-security 1.1.0g-2ubuntu4.1 amd64 [upgradable from: 1.1.0g-2ubuntu4] update-notifier-common/bionic-updates,bionic-updates 3.192.1.1 all [upgradable from: 3.192.1]

Si quisieramos actualizar un solo paquete, por ejemplo openssl, usaremos sudo apt upgrade openssl:

usuario@host:~$ sudo apt upgrade openssl Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-image-3.16.0-77-generic linux-image-extra-3.16.0-77-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: openssl 1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. Need to get 1,21 kB of archives. After this operation, 0,24 B of additional disk space will be used. Do you want to continue? [Y/n] y

Para actualizar todos los paquetes, usaremos sudo apt upgrade:

usuario@host:~$ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: linux-image-3.16.0-77-generic linux-image-extra-3.16.0-77-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: libssl1.0.0 libssl1.1 networkd-dispatcher openssl update-notifier-common 5 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. Need to get 2,921 kB of archives. After this operation, 1,024 B of additional disk space will be used. Do you want to continue? [Y/n] y

Si disponemos de suficiente espacio en el disco, aceptamos la actualización:

Get:1 http://es.archive.ubuntu.com/ubuntu bionic-updates/main amd64 update-notifier-common all 3.192.1.1 [161 kB] Get:2 http://es.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.0g-2ubuntu4.1 [1,128 kB] Get:3 http://es.archive.ubuntu.com/ubuntu bionic-updates/main amd64 networkd-dispatcher all 1.7-0ubuntu3.2 [12.8 kB] Get:4 http://es.archive.ubuntu.com/ubuntu bionic-updates/main amd64 openssl amd64 1.1.0g-2ubuntu4.1 [532 kB] Get:5 http://es.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.0.0 amd64 1.0.2n-1ubuntu5.1 [1,087 kB] Fetched 2,921 kB in 1s (3,439 kB/s) Preconfiguring packages ... (Reading database ... 82066 files and directories currently installed.) Preparing to unpack .../update-notifier-common_3.192.1.1_all.deb ... Unpacking update-notifier-common (3.192.1.1) over (3.192.1) ... Preparing to unpack .../libssl1.1_1.1.0g-2ubuntu4.1_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.0g-2ubuntu4.1) over (1.1.0g-2ubuntu4) ... Preparing to unpack .../networkd-dispatcher_1.7-0ubuntu3.2_all.deb ... Unpacking networkd-dispatcher (1.7-0ubuntu3.2) over (1.7-0ubuntu3) ... Preparing to unpack .../openssl_1.1.0g-2ubuntu4.1_amd64.deb ... Unpacking openssl (1.1.0g-2ubuntu4.1) over (1.1.0g-2ubuntu4) ... Preparing to unpack .../libssl1.0.0_1.0.2n-1ubuntu5.1_amd64.deb ... Unpacking libssl1.0.0:amd64 (1.0.2n-1ubuntu5.1) over (1.0.2n-1ubuntu5) ... Setting up libssl1.0.0:amd64 (1.0.2n-1ubuntu5.1) ... Setting up update-notifier-common (3.192.1.1) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... Setting up libssl1.1:amd64 (1.1.0g-2ubuntu4.1) ... Setting up openssl (1.1.0g-2ubuntu4.1) ... Processing triggers for man-db (2.8.3-2) ... Setting up networkd-dispatcher (1.7-0ubuntu3.2) ... Installing new version of config file /etc/default/networkd-dispatcher ... Processing triggers for libc-bin (2.27-3ubuntu1) ... usuario@host:~$

Una vez finalizado el proceso de upgrade, ya tendremos el sistema al día.
0

0 comentarios:

Publicar un comentario