尝试使用 APT 安装软件包时“无法找到软件包”

尝试使用 APT 安装软件包时“无法找到软件包”

由于找不到错误包,无法安装“sudo”以外的任何东西有人有任何想法吗?我在这里发帖是因为几乎所有问题都已得到解决,主要是想安装 Steam 和其他一些应用程序,例如 leafpad。请记住,我一直在使用 Ubuntu,但最近改为 Debian,只是为了尝试一下。

如果您需要更多信息,请发表评论,谢谢。顺便说一句,我检查了所有其他类似的问题,但没有一个有帮助。

Debian 杰西 8.6

错误:

$ sudo apt-get install <package>
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package <package>

Sources.list 文件:#

# deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD     Binary-1 20160917-14:25]/ jessie contrib main

#deb cdrom:[Debian GNU/Linux 8.6.0 _Jessie_ - Official amd64 DVD Binary-1     20160917-14:25]/ jessie contrib main

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://ftp.au.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://ftp.au.debian.org/debian/ jessie-updates main contrib non-free

答案1

您似乎缺少sources.list 文件。转到/etc/apt并创建一个名为sources.list的新文件

我想你在 Debian Stable ,所以把这些内容放进去:

deb http://httpredir.debian.org/debian/ jessie main non-free contrib
deb http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free

deb-src http://httpredir.debian.org/debian/ jessie main non-free contrib
deb-src http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

如果您将来想尝试 Debian 测试(最新的应用程序、内核等),您需要在此文件中添加测试存储库行,如下所示:

deb http://httpredir.debian.org/debian/ testing main non-free contrib
deb http://httpredir.debian.org/debian/ testing-updates main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free

deb-src http://httpredir.debian.org/debian/ testing main non-free contrib
deb-src http://httpredir.debian.org/debian/ testing-updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

为了进行比较,请查看我的 /etc/apt 文件夹:

root@debian:/home/gv/Desktop/PythonTests# ls -al /etc/apt 
total 56
drwxr-xr-x   6 root root  4096 Jan  4 19:16 .
drwxr-xr-x 131 root root 12288 Jan  4 19:17 ..
drwxr-xr-x   2 root root  4096 Jan  5 00:38 apt.conf.d
-rw-r--r--   1 root root    99 Dec 27 08:42 listchanges.conf
-rw-r--r--   1 root root   218 Jan  1 21:53 preferences
drwxr-xr-x   2 root root  4096 Mar 12  2016 preferences.d
-rw-r--r--   1 root root  1558 Jan  1 22:00 sources.list
drwxr-xr-x   2 root root  4096 Jan  1 21:38 sources.list.d
-rw-r--r--   1 root root  4171 Jan  1 21:38 trusted.gpg
drwxr-xr-x   2 root root  4096 Dec 27 02:58 trusted.gpg.d

相关内容