Preface:I saw that Ubuntu's new version 18.04 was good, so I installed it for fun. Although there are many tutorials to refer to, I will also give a slightly different solution and try to explain it in as much detail as possible. In order to download more conveniently and faster, we often modify the apt source to a domestic source when using the Linux series system. Generally, we choose Alibaba Cloud, Douban, etc. The following briefly describes how to change to Alibaba Cloud source. Ubuntu 18.04 changes apt source to Alibaba Cloud source1. Copy the source file as a backup, just in case The file we want to modify is sources.list, which is in the directory /etc/apt/. sources.list is a configuration file used by the package management tool apt to record the location of the software package repository. There are also various files of the same type with the .list suffix under the sources.list.d file in the same directory. The command is as follows: sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 2. Edit the source list file The command is as follows: sudo vim /etc/apt/sources.list If an error message appears: sudo:vim:command not found, it means that the vim editor is not installed. Use command: sudo apt-get install vim to install 3. View new version information In fact, there is a method for changing the apt source to the domestic source in any version before Ubuntu 18.04. The content is similar, and we should master its rules. In fact, the difference between each version is the version number (or the official one: system code), so let's first understand the system code of the new version: Use the following command: lsb_release -c Get the system code of this system, as shown in the figure below: We can see that the new version of Ubuntu system is codenamed bionic Similarly, we can also get the system code of any previous version:
So this also explains why the contents of so many solutions we found on Baidu are not exactly the same, because they use different systems when changing the apt installation source. 4. Comment out the original content and add the following content (or you can modify the content to the following, but there cannot be any valid content other than the following content)
It is worth noting that the entries in the sources.list file are formatted (as you can see from the above content), generally in the following form deb http://site.example.com/debian distribution component1 component2 component3 deb-src http://site.example.com/debian distribution component1 component2 component3 So the following parameters are the classification of software packages (main, restricted, universe, multiverse in Ubuntu) So you write the content
I had this question before, so I would like to share it with my friends who have the same question as me. 5. Update software list Run the following command: sudo apt-get update 6. Update software packages Run the following command: sudo apt-get upgrade 7. Final words The function and difference between ubuntu sudo update and upgradeEach LINUX distribution, such as UBUNTU, maintains its own software repository, which contains almost all the software we commonly use. The software here is absolutely safe and can be installed normally. Under UBUNTU, we maintain a source list, which contains some URL information. Each URL is a source, and the data pointed to by this address identifies which software can be installed and used on this source server. Edit source command: sudo gedit /etc/apt/sources.list Add or comment out (add #) some sources in this file and save it. At this time, the software pointed to in our source list will increase or decrease. Get a list of recent packages: (The list contains some package information, such as whether the package has been updated) sudo apt-get update This command will access each URL in the source list, read the software list, and save it on the local computer. The software lists seen in the package manager are all updated through the update command. After updating, you may need to upgrade. sudo apt-get upgrade This command will compare the locally installed software with the corresponding software in the software list just downloaded. If it is found that the installed software version is too low, you will be prompted to update it. If your software is the latest version, you will be prompted: 0 packages upgraded, 0 packages newly installed, 0 packages to be uninstalled, and 0 packages not upgraded. In short, update is to update the software list, and upgrade is to update the software. Note: Generally, you need to execute sudo apt-get update before executing the sudo apt-get upgrade command. In fact, it is the same as the software update detection under Windows. The software that needs to be updated will be automatically updated and installed for you. Online direct installation command sudo apt-get install software name The apt-get update command will synchronize the RPM index list (package list) of the client and the APT server. The RPM index list of the APT server is placed in the base folder. After the client computer obtains the bz2 RPM index list compressed file in the base folder, it will decompress it and place it in /var/state/apt/lists/. When the user uses the apt-get install or apt-get dist-upgrade command, the data in this folder will be compared with the RPM database in the client computer. In this way, it can be determined which RPMs are installed, not installed, or can be upgraded. At the same time, I borrowed a few blog posts from blogger gong_xucheng, the address is as follows https://blog.csdn.net/gong_xucheng/article/details/53886271 I would like to express my gratitude here. SummarizeThis is the end of this article about changing the apt source to Alibaba Cloud source in Ubuntu 18.04. For more information about changing the apt source in Ubuntu 18.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of lazy loading and preloading of webpack
>>: In-depth understanding of MySQL various locks
MySQL 8 brings a brand new experience, such as su...
Table of contents VARCHAR and CHAR Types Conclusi...
In a recent project, I wanted to align text verti...
HTML Input Attributes The value attribute The val...
Table of contents Why understand the life cycle W...
template <el-table :data="dataList"&...
They are all web page templates from the foreign ...
Table of contents The beginning of the story Inst...
1. Time difference functions (TIMESTAMPDIFF, DATE...
This article shares with you how to use bootstrap...
Because I want the virtual machine to have its ow...
I'm building Nginx recently, but I can't ...
There is a table student in the mysql database, i...
Table of contents docker system df docker system ...
Table of contents history pushState() Method push...