Home  >  Article  >  Operation and Maintenance  >  How to add update source in linux

How to add update source in linux

小老鼠
小老鼠Original
2023-12-08 09:47:501688browse

Add steps: 1. Open a terminal window; 2. Use a text editor (such as vi or nano) to open the /etc/apt/sources.list file and use "sudo vi /etc/apt/sources.list " command to open the file and add a new update source; 3. Save and close the file; 4. Use the "sudo apt-get update" command in the terminal window to update the update source list to add a new update source.

How to add update source in linux

To add an update source, you can follow these steps:

  • Open a terminal window.
  • Use a text editor (such as vi or nano) to open the /etc/apt/sources.list file. You can open the file using the following command:
    sudo vi /etc/apt/sources.list
  • In the opened file you can add a new update source. Each update source should occupy one line and should begin with "deb" or "deb-src", followed by the URL of the update source. For example:
    deb http://archive.ubuntu.com/ubuntu xenial main restricted
    deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
  • Save and close the file.
  • Use the following command in a terminal window to update your update source list:
    sudo apt-get update
  • The new update source is added and you can use the apt-get command to install or update software Bag.

The above is the detailed content of How to add update source in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn