找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 1824|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

專題三 Ubtun18.04更換apt源為阿里源

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:591424 發(fā)表于 2022-3-23 09:48 | 只看該作者 回帖獎(jiǎng)勵(lì) |正序?yàn)g覽 |閱讀模式
1.使用命令 sudo vim /etc/apt/sources.list 編輯源列表中的源地址信息,將其中的地址全部刪除或者注釋,換成以下下格式

  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  2. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  4. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  7. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  9. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multivers
復(fù)制代碼

2.更新軟件列表

運(yùn)行如下命令:


  1. sudo apt-get update
復(fù)制代碼

這個(gè)命令,會(huì)訪問(wèn)源列表里的每個(gè)網(wǎng)址,并讀取軟件列表,然后保存在本地電腦。軟件包管理器里看到的軟件列表,都是通過(guò)update命令更新的。

3.更新本地軟件包
運(yùn)行如下命令:
  1. sudo apt-get upgrade
復(fù)制代碼

這個(gè)命令,會(huì)把本地已安裝的軟件,與剛下載的軟件列表里對(duì)應(yīng)軟件進(jìn)行對(duì)比,如果發(fā)現(xiàn)已安裝的軟件版本太低,就會(huì)提示你更新。

在執(zhí)行這個(gè)命令的時(shí)候我收到以下錯(cuò)誤提示,沒(méi)有請(qǐng)忽略

  1. E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unavailable)

  2. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it?
復(fù)制代碼
刪除鎖定文件就可以
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock

輸入Yes開始更新本地列表,注意如果沒(méi)出現(xiàn)

0added,0 remove,done.

升級(jí)了 0 個(gè)軟件包,新安裝了 0 個(gè)軟件包,要卸載 0 個(gè)軟件包,有 0 個(gè)軟件包未被升級(jí)。

那就再執(zhí)行一次 sudo apt-get upgrade

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表