下載 libncurses5 失敗

下載 libncurses5 失敗

我無法在我的電腦上安裝 ncurses 庫。當我使用 make 編譯它時,出現致命錯誤 n.curses.h: No such file or directory。

我嘗試透過終端安裝它,但沒有成功。我收到這樣的回覆:sudo apt-get install libncurses5 libncurses5:i386

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libncurses5
E: Unable to locate package libncurses5:i386

我還嘗試修復我的 source.list ,因為我使用了: sudo tee /etc/apt/sources.list

但是,它刪除了文件中的所有內容。在網上搜尋我發現了這個:

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

(...)

複製並貼上到我的 source.list 上,並將 ' #' 放在顯示deb或 的位置deb-src。現在,我無法透過終端下載任何軟體,你能幫我嗎?


uname -a; arch

Linux muca 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
x86_64

答案1

所以您正在執行 64 位元 Ubuntu 20.04 LTS。您可以使用以下單一長命令恢復預設 APT 儲存庫:

cat <<EOF | sudo tee /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ focal-security main universe multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ focal-backports main universe multiverse restricted

deb-src http://archive.ubuntu.com/ubuntu/ focal main universe multiverse restricted
deb-src http://security.ubuntu.com/ubuntu/ focal-security main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main universe multiverse restricted
EOF

增加 32 位元 i386 架構,使用更新軟體包清單並安裝所需的軟體包

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5 libncurses5:i386

相關內容