Tag Archives: ubuntu

Adding python 3.7 to ubuntu 18.x

If you quickly want to get the latest version of Python installed on Ubuntu and get future updates automatically, then you can install it from the below third-party PPA repository…

To do that, run the commands below to add the PPA.

First install Ubuntu software properties package if it’s not already installed on your system..

sudo apt update
sudo apt install software-properties-common

After that run the commands to add the PPA..

 sudo add-apt-repository ppa:deadsnakes/ppa 

Finally, run the commands below to install Python 3.7

sudo apt update
sudo apt install python3.7

That’s it!


Changing the default editor from pico to vim

On new (or new to me systems) I find it annoying to use a program like git, or crontab -e and find myself in the pico editor.  🙁

So, here’s how to change it:

[bash]
sudo update-alternatives –config editor

There are 4 choices for the alternative editor (providing /usr/bin/editor).

Selection Path Priority Status
————————————————————
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 10 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode.
[/bash]

and to confirm your selection, run the same command again, and check out the item that has the asterisk next to it:

[bash]
sudo update-alternatives –config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

Selection Path Priority Status
————————————————————
0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
* 3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 10 manual mode

Press enter to keep the current choice[*], or type selection number:
[/bash]

If that still doesn’t work, try this instead:

[bash]
export EDITOR=/usr/bin/vim.basic
[/bash]