How to update Kali Linux

If you have a persistent installation of Kali Linux, it is vital to keep the operating system up to date. You can follow these steps to update Kali. Please note that you will need an active Internet connection. The time required for this process will depend on the speed of your Internet connection.

Open the Terminal and enter the following command. It will download the package lists from various repositories and update them to get information on the newest versions of packages and their dependencies.

apt-get update

Update installed software packages using the following command. -y argument is given so you don't have to manually enter it.

apt-get upgrade -y

The following command will remove obsolete packages.

apt-get dist-upgrade -y

Reboot the machine.

reboot

You can use a shell script to automate this process. It is useful to update Kali Linux regularly. Open a Terminal window and enter the following command to create a new file and open it using a text editor.

leafpad kaliupdatescript.sh 

It will open a new empty file created in the file system. Enter the following single line of text into the file.

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && reboot

Save and close the file. You can see that new file has created in the file system.










Change the file access permissions to execute.

chmod +x kaliupdatescript.sh 

You can see that file access permissions changed. File colour is changed to green colour.











Execute the script using the following command. You can execute the script whenever you want to update the system. It will automatically reboot the system after the update process.


./kaliupdatescript.sh

If you get any error message or the blank screen without any buttons, you can open the virtual terminal by using following keyboard combinations.

Ctrl + Alt + F4

You need to log in as a 'root' user. Enter 'root' for the username and 'toor' for the password (without apostrophe mark). Now you can repeat the update routing stated in this blog post to solve the problem. 

  

Comments