【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
- Linux下安裝/更新Firefox且安裝/更新Flash的方法LinuxFirefox
- OS-Ubuntu-從源查詢拉取安裝包依賴-apt-cache&apt downloadUbuntuAPT
- 如何使用APT庫安裝MySQLAPTMySql
- ubuntu apt-get 解除安裝Ubuntuapt-get
- Ubuntu apt-get 安裝 MongoDBUbuntuapt-getMongoDB
- Ubuntu 軟體安裝命令:aptUbuntuAPT
- Linux中如何透過yum或者apt下載安裝MySQLLinuxAPTMySql
- apt-get install **安裝opencvapt-getOpenCV
- cygwin安裝配置apt-cyg工具APT
- RedHat Linux 本地Yum源安裝RedhatLinux
- ubuntu 20.04 apt 安裝 PHP8.0UbuntuAPTPHP
- Ubuntu APT 換源UbuntuAPT
- 【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- 在ubuntu中用apt-get安裝LEMP棧(linux+nginx+mysql+php)Ubuntuapt-getLinuxNginxMySqlPHP
- 無法更新apt映象源?樹莓派安裝最新版Debian11(bullseye)arm64位系統步驟APT樹莓派
- linux源瑪包編譯安裝Linux編譯
- Debian/Ubuntu包安裝工具APT的使用UbuntuAPT
- 使用apt install安裝本地deb檔案APT
- Red Hat Linux安裝CentOS的yum源LinuxCentOS
- 利用Rpmforge更新centosyum源快速安裝nagios與cactiCentOSiOS
- [轉帖]【Linux】使用 apt-get 查詢並安裝指定版本的軟體Linuxapt-get
- Ubuntu 22.04 LTS下透過第三方apt源安裝php8.3.xUbuntuAPTPHP
- Linux CentOS 7 更新yum源LinuxCentOS
- 為了安裝alien,我更新了yum源,結果還是沒裝上
- 如何在 Linux 上安裝/更新 Intel 微碼韌體LinuxIntel
- ubuntu 14.04 下通過apt-get 安裝jdkUbuntuapt-getJDK
- 使用APT對redhat進行更新(轉)APTRedhat
- Linux伺服器配置——安裝CentOS以及源配置Linux伺服器CentOS
- redhat linux 5 之配置YUM源並安裝包RedhatLinux
- Linux下常用元件映象源、smaba、gcc、ssh安裝Linux元件GC
- pip 清華源安裝
- pip安裝源配置
- postgres yum源安裝
- linux 安裝yum 安裝phpLinuxPHP
- Linux安裝解除安裝MySQLLinuxMySql
- 國內linux apt-get sources.list 163 正規源Linuxapt-get
- linux中安裝JDK linux中安裝Tomcat linux中安裝Mysql 及故障解析 linux系統安裝redisLinuxJDKTomcatMySqlRedis