編碼的世界 / 優質文選 / 女人

Linux安裝程序包之Unable to locate package錯誤 解決辦法


2021年10月22日
-   

  • 在ubuntu系統下,利用apt-get install命令安裝程序,出現如下問題。

jianliu@ubuntu:~$ sudo apt-get install mysql-server mysql-client
Reading package lists Done
Building dependency tree
Reading state information Done
E: Unable to locate package mysql-server
E: Unable to locate package mysql-client

  • 可能願意與解決方法:

(1) 可能在執行apt -get install 命令前,修改了軟件源。 ———-所以應該調用apt-get update ,更新源,然後再執行apt-get install命令安裝程序包就OK 了。(2)可能所選的軟件源存在問題,需要換一個軟件源。
 #一開始選用了uestc的軟件源:http:/ubuntu.uestc.cn/ubuntu,出現錯誤!
jianliu@ubuntu:~$ sudo apt-get update
Ign http://extras.ubuntu.com trusty InRelease
Hit http://ppa.launchpad.net trusty InRelease
Hit http://extras.ubuntu.com trusty Release.gpg
Hit http://extras.ubuntu.com trusty Release
Hit http://extras.ubuntu.com trusty/main Sources
Hit http://extras.ubuntu.com trusty/main amd64 Packages
Hit http://extras.ubuntu.com trusty/main i386 Packages
Ign http://extras.ubuntu.com trusty/main Translation-en_US
Ign http://extras.ubuntu.com trusty/main Translation-en
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Err http://ubuntu.uestc.edu.cn trusty InRelease
Err http://ubuntu.uestc.edu.cn trusty-updates InRelease
Err http://ubuntu.uestc.edu.cn trusty-backports InRelease
Err http://ubuntu.uestc.edu.cn trusty-security InRelease
Err http://ubuntu.uestc.edu.cn trusty Release.gpg
Unable to connect to ubuntu.uestc.edu.cn:http:
Err http://ubuntu.uestc.edu.cn trusty-updates Release.gpg
Unable to connect to ubuntu.uestc.edu.cn:http:
Err http://ubuntu.uestc.edu.cn trusty-backports Release.gpg
Unable to connect to ubuntu.uestc.edu.cn:http:
Err http://ubuntu.uestc.edu.cn trusty-security Release.gpg
Unable to connect to ubuntu.uestc.edu.cn:http:
Reading package lists Done
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty/InRelease
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-updates/InRelease
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-backports/InRelease
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-security/InRelease
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty/Release.gpg Unable to connect to ubuntu.uestc.edu.cn:http:
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-updates/Release.gpg Unable to connect to ubuntu.uestc.edu.cn:http:
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-backports/Release.gpg Unable to connect to ubuntu.uestc.edu.cn:http:
W: Failed to fetch http://ubuntu.uestc.edu.cn/ubuntu/dists/trusty-security/Release.gpg Unable to connect to ubuntu.uestc.edu.cn:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.

#後面換成cn99的軟件源:http://unbuntu.cn99.com/ubuntu,一切正常!
jianliu@ubuntu:~$ sudo apt-get update
Ign http://ubuntu.cn99.com trusty InRelease
Hit http://ubuntu.cn99.com trusty-updates InRelease
Hit http://ubuntu.cn99.com trusty-backports InRelease
Hit http://ubuntu.cn99.com trusty-security InRelease
Hit http://ubuntu.cn99.com trusty Release.gpg
Hit http://ubuntu.cn99.com trusty-updates/main Sources
Hit http://ubuntu.cn99.com trusty-updates/restricted Sources
Hit http://ubuntu.cn99.com trusty-updates/universe Sources
Hit http://ubuntu.cn99.com trusty-updates/multiverse Sources
Hit http://ubuntu.cn99.com trusty-updates/main amd64 Packages
Ign http://extras.ubuntu.com trusty InRelease
Hit http://ubuntu.cn99.com trusty-updates/restricted amd64 Packages
Hit http://ubuntu.cn99.com trusty-updates/universe amd64 Packages
Hit http://ppa.launchpad.net trusty InRelease
Hit http://ubuntu.cn99.com trusty-updates/multiverse amd64 Packages
Hit http://ubuntu.cn99.com trusty-updates/main i386 Packages
Hit http://ubuntu.cn99.com trusty-updates/restricted i386 Packages
Hit http://ubuntu.cn99.com trusty-updates/universe i386 Packages
Hit http://extras.ubuntu.com trusty Release.gpg
Hit http://ubuntu.cn99.com trusty-updates/multiverse i386 Packages
Hit http://ubuntu.cn99.com trusty-updates/main Translation-en
Hit http://ubuntu.cn99.com trusty-updates/multiverse Translation-en
Hit http://ubuntu.cn99.com trusty-updates/restricted Translation-en
Hit http://extras.ubuntu.com trusty Release
Hit http://ubuntu.cn99.com trusty-updates/universe Translation-en
Hit http://ubuntu.cn99.com trusty-backports/main Sources
Hit http://ubuntu.cn99.com trusty-backports/restricted Sources
Hit http://ubuntu.cn99.com trusty-backports/universe Sources
Hit http://ubuntu.cn99.com trusty-backports/multiverse Sources
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://ubuntu.cn99.com trusty-backports/main amd64 Packages
Hit http://extras.ubuntu.com trusty/main Sources
Hit http://ubuntu.cn99.com trusty-backports/restricted amd64 Packages
Hit http://ubuntu.cn99.com trusty-backports/universe amd64 Packages
Hit http://ubuntu.cn99.com trusty-backports/multiverse amd64 Packages
Hit http://ubuntu.cn99.com trusty-backports/main i386 Packages
Hit http://ubuntu.cn99.com trusty-backports/restricted i386 Packages
Hit http://ubuntu.cn99.com trusty-backports/universe i386 Packages
Hit http://extras.ubuntu.com trusty/main amd64 Packages
Hit http://ubuntu.cn99.com trusty-backports/multiverse i386 Packages
Hit http://ubuntu.cn99.com trusty-backports/main Translation-en
Hit http://ubuntu.cn99.com trusty-backports/multiverse Translation-en
Hit http://ubuntu.cn99.com trusty-backports/restricted Translation-en
Hit http://extras.ubuntu.com trusty/main i386 Packages
Hit http://ubuntu.cn99.com trusty-backports/universe Translation-en
Hit http://ubuntu.cn99.com trusty-security/main Sources
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ubuntu.cn99.com trusty-security/restricted Sources
Hit http://ubuntu.cn99.com trusty-security/universe Sources
Hit http://ubuntu.cn99.com trusty-security/multiverse Sources
Hit http://ubuntu.cn99.com trusty-security/main amd64 Packages
Hit http://ubuntu.cn99.com trusty-security/restricted amd64 Packages
Hit http://ubuntu.cn99.com trusty-security/universe amd64 Packages
Hit http://ubuntu.cn99.com trusty-security/multiverse amd64 Packages
Hit http://ubuntu.cn99.com trusty-security/main i386 Packages
Hit http://ubuntu.cn99.com trusty-security/restricted i386 Packages
Hit http://ubuntu.cn99.com trusty-security/universe i386 Packages
Hit http://ubuntu.cn99.com trusty-security/multiverse i386 Packages
Hit http://ubuntu.cn99.com trusty-security/main Translation-en
Hit http://ubuntu.cn99.com trusty-security/multiverse Translation-en
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://ubuntu.cn99.com trusty-security/restricted Translation-en
Hit http://ubuntu.cn99.com trusty-security/universe Translation-en
Hit http://ubuntu.cn99.com trusty Release
Hit http://ubuntu.cn99.com trusty/main Sources
Hit http://ubuntu.cn99.com trusty/restricted Sources
Hit http://ubuntu.cn99.com trusty/universe Sources
Hit http://ubuntu.cn99.com trusty/multiverse Sources
Hit http://ubuntu.cn99.com trusty/main amd64 Packages
Hit http://ubuntu.cn99.com trusty/restricted amd64 Packages
Hit http://ubuntu.cn99.com trusty/universe amd64 Packages
Hit http://ubuntu.cn99.com trusty/multiverse amd64 Packages
Hit http://ubuntu.cn99.com trusty/main i386 Packages
Hit http://ubuntu.cn99.com trusty/restricted i386 Packages
Hit http://ubuntu.cn99.com trusty/universe i386 Packages
Hit http://ubuntu.cn99.com trusty/multiverse i386 Packages
Hit http://ubuntu.cn99.com trusty/main Translation-en
Hit http://ubuntu.cn99.com trusty/multiverse Translation-en
Hit http://ubuntu.cn99.com trusty/restricted Translation-en
Hit http://ubuntu.cn99.com trusty/universe Translation-en
Ign http://extras.ubuntu.com trusty/main Translation-en_US
Ign http://ubuntu.cn99.com trusty/main Translation-en_US
Ign http://ubuntu.cn99.com trusty/multiverse Translation-en_US
Ign http://ubuntu.cn99.com trusty/restricted Translation-en_US
Ign http://ubuntu.cn99.com trusty/universe Translation-en_US
Ign http://extras.ubuntu.com trusty/main Translation-en
Reading package lists Done

  • 軟件源的設置 system setting——>software & Updates——>Ubuntu Software—>[Download from ]
    ————-默認情況下,選擇的美國的軟件源,速度很慢!

————--建議選用高校和大公司的軟件源。這樣apt-get install 安裝程序包時速度比較快!

熱門文章