【Linux】Utuntu 更新 apt 安裝源
在Linux系統下,有時候安裝一些包時會報一些問題,常見的就有,找不到安裝源和訪問外網時間過程time out等等,那麼怎麼半呢?
我們可以把國內一下很不錯的映象網站給新增進去,這樣就能很大程度上減少報錯的問題。下面就是更新 apt 安裝源的步驟:
首先進入/etc/apt/, 將sources.list檔案先備份一下:
cp sources.list sources.list.back
然後 開啟sources.list 檔案,新增新的安裝源:
#清華源
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 multiversedeb-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 multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#中科大源 deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
後面幾個引數是對軟體包的分類(Ubuntu下是main, restricted,universe ,multiverse這四個)
新增之後,儲存退出,並進行更新
sudo apt update
sudo apt upgrade
相關文章
- apt安裝zabbixAPT
- OS-Ubuntu-從源查詢拉取安裝包依賴-apt-cache&apt downloadUbuntuAPT
- Linux中如何透過yum或者apt下載安裝MySQLLinuxAPTMySql
- Ubuntu 軟體安裝命令:aptUbuntuAPT
- 如何使用APT庫安裝MySQLAPTMySql
- apt-get install **安裝opencvapt-getOpenCV
- ubuntu apt-get 解除安裝Ubuntuapt-get
- linux源瑪包編譯安裝Linux編譯
- 【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- ubuntu 20.04 apt 安裝 PHP8.0UbuntuAPTPHP
- cygwin安裝配置apt-cyg工具APT
- Red Hat Linux安裝CentOS的yum源LinuxCentOS
- 無法更新apt映象源?樹莓派安裝最新版Debian11(bullseye)arm64位系統步驟APT樹莓派
- 使用apt install安裝本地deb檔案APT
- [轉帖]【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- Linux CentOS 7 更新yum源LinuxCentOS
- Ubuntu APT 換源UbuntuAPT
- 如何在 Linux 上安裝/更新 Intel 微碼韌體LinuxIntel
- Linux下常用元件映象源、smaba、gcc、ssh安裝Linux元件GC
- Linux伺服器配置——安裝CentOS以及源配置Linux伺服器CentOS
- linux中安裝JDK linux中安裝Tomcat linux中安裝Mysql 及故障解析 linux系統安裝redisLinuxJDKTomcatMySqlRedis
- Ubuntu 22.04 LTS下透過第三方apt源安裝php8.3.xUbuntuAPTPHP
- Linux安裝解除安裝MySQLLinuxMySql
- linux 安裝yum 安裝phpLinuxPHP
- 為了安裝alien,我更新了yum源,結果還是沒裝上
- linux下安裝snap安裝工具Linux
- Linux 解除安裝openjdk 安裝oraclejdkLinuxJDKOracle
- linux 解除安裝jdk和安裝LinuxJDK
- Laravel swoole安裝及使用及inotify熱更新 (Linux centos環境)LaravelLinuxCentOS
- Linux安裝之Linux mintLinux
- 11. Oracle for Linux安裝和配置——11.2. Linux安裝和配置——11.2.2.Linux安裝(1)OracleLinux
- 11. Oracle for Linux安裝和配置——11.2. Linux安裝和配置——11.2.2.Linux安裝(2)OracleLinux
- linux安裝sshLinux
- Linux安裝NginxLinuxNginx
- linux 安裝 nginxLinuxNginx
- Linux安裝gitLinuxGit
- Manjaro Linux安裝JARLinux
- Linux安裝MySQLLinuxMySql