Ahmad Dahlan I'm just ordinary man with a big dream

Cara Update dan Upgrade OS Ubuntu Server via Terminal

3 min read

Perintah Update server OS Ubuntu

Matamu.NET – OS Ubuntu adalah salah satu server open Source yang paling rutin update berkala. Tujuannya tentu saja memaksimalkan kinerja dan sistem pengamanan agar layanan server optimal dan terlindungi. Karena sifatnya yang open source maka update OS Server Ubuntu bisa dilakukan gratis dengan cara mengecek ketersedian update lalu update.

Agar lebih mudah berikut ini langkah-langkah update server ubuntu, menggunakan Command Line. Silahkan loogin dulu ke Server Unda bisa melalui ssh atau panel server anda. Terserah yang mana nyamannya.

Langkah-Langkah Update Server via Terminal

Ada banyak metode yang bisa ditemuh untuk update server ubuntu namun cara paling lazim adalah penggunakan perintah APT untuk dapatkan detail mengenai package manager.

Langkah pertama adalah cek daftar update paket yang tersedia di Repository dengan perintah

sudo apt update

Jika tersedia akan muncul contoh informasi sebagai berikut :


root@vultr:~# sudo apt update                                                                                                                                    
Hit:1 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease                                                                                           
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                                                          
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                        
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                                      
Hit:5 http://s3-eu-west-1.amazonaws.com/tideways/packages debian InRelease                                                                                       
Hit:6 http://nginx.org/packages/ubuntu bionic InRelease                                                                                                          
Get:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]                                                                                      
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                                                      
Get:9 http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu bionic InRelease [15.9 kB]                                                                                  
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,249 kB]                                                                            
Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1,904 kB]                                                                          
Get:12 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages [101 kB]                                                                            
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,360 kB]                                                                             
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [438 kB]                                                                              
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [492 kB]                                                                        
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [66.7 kB]                                                                       
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,580 kB]                                                                         
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,755 kB]                                                                        
Get:19 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main i386 Packages [100 kB]                                                                             
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [376 kB]                                                                          
Get:21 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [1,055 kB]                                                                           
Get:22 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [345 kB]                                                                            
Get:23 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [468 kB]                                                                      
Get:24 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [63.0 kB]                                                                     
Get:25 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [988 kB]                                                                         
Get:26 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,140 kB]                                                                      
Get:27 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [260 kB]                                                                        
Fetched 15.0 MB in 6s (2,469 kB/s)                                                                                                                                
Reading package lists... Done                                                                                                                                    
Building dependency tree                                                                                                                                         
Reading state information... Done                                                                                                                                
44 packages can be upgraded. Run 'apt list --upgradable' to see them.                                                                                            
N: Skipping acquire of configured file 'nginx/binary-i386/Packages' as repository 'http://nginx.org/packages/ubuntu bionic InRelease' doesn't support architectur
e 'i386'  

Angka di sebelah adlah informasi ukuran file jadi pastikan space SSD / HD anda cukup, namun biasanya sih cukup soalnya filenya lumayan kecil, kecuali space anda memang kurang dari 5 GB.

Setelah itu silahkan update dengan perintah upgrade :

sudo apt upgrade

Setelah tekan enter akan muncul nama-nama file, aplikasi dan sejenisnya yang bisa di update. Tekan Y untuk konfirmasi jika ingin update.

Contoh Nama filenya seperti di bawah ini, semakin lama anda tidak update semakin banyak nama yang akan muncul.

root@vultr:~# 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:                                                                                  
  libjs-openlayers linux-headers-4.15.0-134 linux-headers-4.15.0-134-generic linux-headers-4.15.0-135 linux-headers-4.15.0-135-generic linux-headers-4.15.0-136  
  linux-headers-4.15.0-136-generic linux-headers-4.15.0-137 linux-headers-4.15.0-137-generic linux-headers-4.15.0-140 linux-headers-4.15.0-140-generic           
  linux-headers-4.15.0-143 linux-headers-4.15.0-143-generic linux-headers-4.15.0-147 linux-headers-4.15.0-147-generic linux-headers-4.15.0-153                   
  linux-headers-4.15.0-153-generic linux-headers-4.15.0-76 linux-headers-4.15.0-76-generic linux-image-4.15.0-134-generic linux-image-4.15.0-135-generic         
  linux-image-4.15.0-136-generic linux-image-4.15.0-137-generic linux-image-4.15.0-140-generic linux-image-4.15.0-143-generic linux-image-4.15.0-147-generic     
  linux-image-4.15.0-153-generic linux-image-4.15.0-76-generic linux-modules-4.15.0-134-generic linux-modules-4.15.0-135-generic                                 
  linux-modules-4.15.0-136-generic linux-modules-4.15.0-137-generic linux-modules-4.15.0-140-generic linux-modules-4.15.0-143-generic                            
  linux-modules-4.15.0-147-generic linux-modules-4.15.0-153-generic linux-modules-4.15.0-76-generic linux-modules-extra-4.15.0-134-generic                       
  linux-modules-extra-4.15.0-135-generic linux-modules-extra-4.15.0-136-generic linux-modules-extra-4.15.0-137-generic linux-modules-extra-4.15.0-140-generic    
  linux-modules-extra-4.15.0-143-generic linux-modules-extra-4.15.0-147-generic linux-modules-extra-4.15.0-153-generic linux-modules-extra-4.15.0-76-generic     
  php5.6-igbinary php5.6-imagick php5.6-redis php7.0-igbinary php7.0-imagick php7.0-redis php7.1-igbinary php7.1-imagick php7.1-redis php7.2-igbinary            
  php7.2-imagick php7.2-redis php7.3-igbinary php7.3-imagick php7.3-redis php7.4-igbinary php7.4-imagick php7.4-redis                                            
Use 'sudo apt autoremove' to remove them.                                                                                                                        
The following NEW packages will be installed:                                                                                                                    
  linux-headers-4.15.0-159 linux-headers-4.15.0-159-generic linux-image-4.15.0-159-generic linux-modules-4.15.0-159-generic                                      
  linux-modules-extra-4.15.0-159-generic                                                                                                                         
The following packages will be upgraded:                                                                                                                         
  apache2-utils ca-certificates curl libcurl3-gnutls libcurl4 linux-generic linux-headers-generic linux-image-generic linux-libc-dev php5.6-common               
  php7.0-common php7.1-common php7.3-common php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-common php7.4-curl php7.4-fpm php7.4-gd php7.4-gmp php7.4-intl            
  php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-readline php7.4-soap php7.4-sqlite3 php7.4-xml php7.4-xmlrpc php7.4-zip php8.0-cli              
  php8.0-common php8.0-dev php8.0-mysql php8.0-opcache php8.0-readline snapd vim vim-common vim-runtime vim-tiny xxd                                             
44 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.                                                                                                  
14 standard security updates                                                                                                                                     
Need to get 111 MB of archives.                                                                                                                                  
After this operation, 350 MB of additional disk space will be used.   
Do you want to continue? [Y/n]                                                                                           

Ketik Y lalu enter, maka proses update akan berjalan. Lama prosesnya tergantung seberapa cepat koneksi internet server anda dan banyaknay file.

Jika porses sudah selesai, jangan lupa restart dengan perintah

sudo reboot

Prosesnya bakalan terlihat seperti di bawah

Cuplikan proses update server ubuntu

Cara Cepat Update

Jika anda malas membaca jenis file yang ingin di updaten dan sudah yakin semua update anda butuhkan maka perintahnay bisa dibuat lebih sederhana dengan perintah :

sudo apt update && sudo apt upgrade -y

Meskipun tidak butuh perintah restart OS saat sudah update tapi saya lebih suka merestartnya untuk memastikan updatetanya berjalan.

Ahmad Dahlan I'm just ordinary man with a big dream

Leave a Reply

Your email address will not be published. Required fields are marked *