无法安装任何软件包

无法安装任何软件包

我无法使用 apt install 安装任何软件包。我收到以下错误

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

当我执行 apt-get update 时

# apt-get update
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [1,539 B]
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [1,548 B]
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
    Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [1,547 B]
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
    Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:4 http://archive.ubuntu.com/ubuntu main InRelease [1,537 B]
Err:4 http://archive.ubuntu.com/ubuntu main InRelease
    Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:5 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton InRelease [1,554 B]
Err:5 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton InRelease
    Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 7,725 B in 0s (13.5 kB/s)
Reading package lists... Done
W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/main/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://ubuntu-cloud.archive.canonical.com/ubuntu/dists/xenial-updates/newton/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.

在此之前,我尝试卸载 mysql,然后按照此操作

apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb

在此之后我才收到此错误。请帮我解决这个问题。

答案1

看来您在尝试期间无法访问互联网。尝试 ping google.com 或访问互联网,如果可以,则尝试再次运行。我在唤醒笔记本电脑后遇到了互联网访问问题,因此我至少会尝试“systemctl restart networking”。

可能还值得检查一下 /boot/ 分区是否已满。运行“df -h”查看那里有多少可用空间。

我知道我的回答可能听起来有点傻,但是在尝试更新/升级/安装软件包之前,你不能忘记检查基础知识。

相关内容