Replace the Tsinghua image on the Ubuntu virtual machine and install python3

Before installing python, first replace the image. I used the Tsinghua mirror. Of course, Ali and the University of Science and Technology are available. You can search the mirror path directly on the Internet. (Please search and copy under the Ubuntu system. If you find it under Windows , Copying to Ubuntu is very complicated.)
One,

  1. Open the terminal and enter the command below (backup the /etc/apt/sources.list file)

sudo cp /etc/apt/sources.list /etc/apt/old_sources.list

Insert picture description here

  1. (vim opens the file that saves the source content:)

sudo vim /ect/apt/sources.list

Insert picture description here

  1. At this time, the file to be edited will be opened, and sometimes you may be allowed to choose, read-only or edit, etc., select edit (E), and then enter the editing state of the file. In this state, the file will be owned Delete all the contents of, then copy all the mirror images you have selected in, and ESC key to exit editing,: wq! save and exit. Attach the Tsinghua image file:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

  1. After exiting, remember to update. Enter the command line:

sudo apt-get upgrade

  1. After the terminal is updated, corresponding operations must be performed on the desktop. As follows, just
    Insert picture description hereInsert picture description hereInsert picture description hereInsert picture description here
    wait for reloading, so that the mirroring change is completed. (If there is an error during the update, the error on the first line will be displayed. It may be just multiple spaces. Just enter the editing interface and change it. Of course, it may be The version does not match the content of the mirror, mine is Ubuntu 18.04 version).

Second, the installation of python3, the following command line, I also found it from the Internet, but the first step was an error. Figure 2 is my historical command line. After the historical command line, I knocked bit by bit and finally python3 was installed successfully. After success, you can edit the python program.
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/A_Tu_daddy/article/details/103350283