linux在下軟體太卡?手把手教你配置國內鏡像源

来源:https://www.cnblogs.com/lxy0/archive/2020/04/13/12694270.html
-Advertisement-
Play Games

ubuntu18.04 配置國內鏡像源 修改配置文件 1. 手動更改 用你熟悉的編輯器打開 ,例如 以 為例把下列內容複製替換 中的全部內容( "使用阿裡雲鏡像" ): 2. 一鍵更改 通過 獲取配置文件(前提你的電腦得有wget,沒有的話運行 ),例如獲取ubuntu18.04的配置文件為例( " ...


ubuntu18.04 配置國內鏡像源

修改配置文件

  1. 手動更改

    • 用你熟悉的編輯器打開/etc/apt/sources.list ,例如 vi /etc/apt/sources.list
    • ubuntu 18.04(bionic) 為例把下列內容複製替換sources.list中的全部內容(使用阿裡雲鏡像):
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    
    
  2. 一鍵更改

    通過wget獲取配置文件(前提你的電腦得有wget,沒有的話運行sudo apt-get install wget ),例如獲取ubuntu18.04的配置文件為例(使用騰訊雲鏡像),阿裡雲鏡像沒有找到現成的配置文件,用騰訊雲代替

    wget -O /etc/apt/sources.list http://mirrors.cloud.tencent.com/repo/ubuntu18_sources.list
    

其他版本可在阿裡雲或者騰訊雲鏡像查看即可。

更新緩存

apt-get clean all
apt-get update

Centos7 配置國內鏡像源

和ubuntu基本類似,只是文件路徑稍有不同

  1. 下載新的CentOS-Base.repo文件到 /etc/yum.repos.d/例如:

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

    或者

    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

  2. 或者使用 vi /etc/yum.repos.d/CentOS-Base.repo替換成一下內容

    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the 
    # remarked out baseurl= line instead.
    #
    #
     
    [base]
    name=CentOS-$releasever - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
     
    #released updates 
    [updates]
    name=CentOS-$releasever - Updates - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
     
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
     
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
     
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
            http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
            http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
    
    
    
  3. 最後運行更新緩存

    yum clean all
    yum makecache
    

詳細參考阿裡雲鏡像站騰訊軟體源


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • Navicat is a series of graphical database management and development software produced by PremiumSoft CyberTech Ltd. for MySQL, MariaDB, Oracle, SQLit... ...
  • 昨天大致把思路理清楚了,用one hot的方式把關鍵詞按字拆開編碼,今天嘗試可行性。 目前主流的文本向量化方式主要包括one hot、tf (term frequency)和tf idf (term frequency–inverse document frequency)這三種,越往後準確度應該越 ...
  • 前言 在上一篇導出文檔番外篇中,我們已經熟悉了怎樣根據json數據導出word的文檔,生成介面文檔,而在這一篇,將對上一篇進行完善補充,增加多種導出方式,實現更加完善的導出功能。 回顧 1. 獲取Swagger介面文檔的Json文件 2. 解析Json文件數據填充到Html的表格中 3.根據生成的h ...
  • 現如今當你翻看一些開源項目源碼的時候,你會發現現在到處充斥著委托函數,如Func,Action,Predicate,確實現在的C 在函數式編程的路上越來越成為主流,越來越顯示威力,曾經的一些經典設計模式寫法,在函數式下可以稍微優化一下了,這篇我們就來說說模板方法。 一:實際場景 1. 模板方法定義 ...
  • Vim在Linux中是一個簡單卻又強大的文本編輯器,可以用來創建、編輯和查看一個文本。本文只是簡單介紹下,更多用法還得個人多使用練習才行。 Vim通常分為三種模式:命令模式:剛打開Vim時就預設進入命令模式,此時所有的鍵盤敲擊都會被識別為命令而不是字元輸入,而編輯器則處於等待用戶輸入命令的狀態。輸入 ...
  • 本文講一些查看文件內容的常用方法,以及在文件中搜索關鍵字的常用方法,但是註意,這些方法都不能編輯文件內容,編輯文件內容需要vi、vim等編輯器來進行。 註釋在配置文件或shell腳本中,一行中井號#之後的內容為註釋,而不是有效的配置設置或代碼。 cat命令 cat [-n] 文件名:顯示文件內容,但 ...
  • 本文講了一些文件和目錄本身的基礎知識和操作,如新建、複製、移動等,並不涉及文件內容的查看、編輯、搜索等操作。 文件歸屬 文件的歸屬只有三種關係: 所有者u:即文件的擁有者,並且一個文件同時只能有一個所有者,一般是誰創建的文件,這個文件的所有者就是誰。 所屬組g:文件歸屬的組,並且一個文件同時只能歸屬 ...
  • Apple 史上以來最大的bootstrap漏洞 ,已經涉及A7-A10,帶來了全新的 越獄體驗。 工具地址:checkra.in 暫時支持:linux,macos,Windows還在開發中。 ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...