In this post we’ll be going through on how to update, uninstall and install packages/programs through the terminal with the apt-get command & how to read log files easily.
First off we’ll need to open the terminal from where you will be sending the commands. You will need administrator level privileges to be able to use the apt-get command.
As always before you do anything be sure you have backed up all your important files.
The apt-get command is a powerful, but yet simple and easy to understand command. With apt-get you can update, uninstall, install and do lots of more commands that help you to mange your programs/packages without any real hassle.
but unless you are logged in as root and have all your security settings changed you won’t be able to initiate apt-get. You’ll need to add sudo in front of the command to tell the system that you want to use the super user permissions for a short while to change important things.
Every single file that can be updated will be displayed in order and you will be asked if you want to update the specific package/program. To avoid having to press Y to accept the update for too many packages you can add the flag -y to the command. This will make the apt-get command run through it’s job and update everything without asking you every time about something.
So now your command should look something like this:
sudo apt-get -y
Now we’ll have to add the command to tell apt-get what we want to do with it.
To update a non-essential package/program in your Linux distribution we simply need to type this command:
sudo apt-get -y update
To update a essential package/program in your Linux distribution we simply need to type this command:
sudo apt-get -y upgrade
To uninstall a package/program in your linux distribution we simply need to type this command:
sudo apt-get -y purge example
This will remove the package/program called example, but be careful with this command
To install a package/program in your Linux distribution we simply need to type this command:
sudo apt-get -y install example
This will install the package/program called example.
Let’s see an example:
We’ll be installing these new packages/programs on your Linux distribution:
- Putty – An SSH client used to connect to other servers for easy server terminal access
- FileZilla – An SFTP client used to connect to other servers for easy file management
- VLC – A media player for music, videos and more
- GCC – The GNU compiler collection
- Gedit – A simple & advanced text editor
- Winrar – A program used to compress file(s) into archives for easy storage & transportation (sending&receiving)
We’ll be updating also all the non-essential and essential packages/programs.
sudo apt-get -y install putty filezilla vlc gcc gedit winrar && sudo apt-get -y update && sudo apt-get -y upgrade
Reading log files