无法下载 libncurses5

无法下载 libncurses5

我无法在计算机上安装 ncurses 库。当我使用 make 编译它时,我收到致命错误 n.curses.h:没有这样的文件或目录。

我尝试通过终端安装它,但是没有成功。我得到了以下响应: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 上,并将“ #”放置在其显示的位置debdeb-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

相关内容