搬到另一个国家后,使用“sudo apt-get update”遇到困难

搬到另一个国家后,使用“sudo apt-get update”遇到困难

我从土耳其临时搬到德国 1.5 个月,代码

sudo apt-get update

无法按预期工作,产生大量错误。为了避免这种情况,我尝试从目录中删除以下文件/etc/apt/sources.list.d/;此外,我在 sources.list 文件中注释掉几行,但无济于事。每次罪魁祸首都是不同的。sudo rm ubuntu-x-swat-x-updates-precise.list sudo rm ubuntu-x-swat-x-updates-precise.list.save

该命令的输出sudo apt-get update可以在以下链接中找到:

http://paste.ubuntu.com/7905503/

以下是 apt-config dump 的输出:

paste.ubuntu.com/7898595

包含“获取”的文件

// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}-security";
//  "${distro_id}:${distro_codename}-updates";
//  "${distro_id}:${distro_codename}-proposed";
//  "${distro_id}:${distro_codename}-backports";
};

// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
//  "vim";
//  "libc6";
//  "libc6-dev";
//  "libc6-i686";
};

// This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run 
//   dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed
//Unattended-Upgrade::AutoFixInterruptedDpkg "false";

// Split the upgrade into the smallest possible chunks so that
// they can be interrupted with SIGUSR1. This makes the upgrade
// a bit slower but it has the benefit that shutdown while a upgrade
// is running is possible (with a small delay)
//Unattended-Upgrade::MinimalSteps "true";

// Install all unattended-upgrades when the machine is shuting down
// instead of doing it in the background while the machine is running
// This will (obviously) make shutdown slower
//Unattended-Upgrade::InstallOnShutdown "true";

// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed.
//Unattended-Upgrade::Mail "root@localhost";

// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
//Unattended-Upgrade::MailOnlyOnError "true";

// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
//Unattended-Upgrade::Remove-Unused-Dependencies "false";

// Automatically reboot *WITHOUT CONFIRMATION* if a 
// the file /var/run/reboot-required is found after the upgrade 
//Unattended-Upgrade::Automatic-Reboot "false";


// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";

答案1

您不能直接从系统设置>软件和更新获取更新吗?

您可以在此屏幕中选择下载来源...

如果我误解了您的请求,请提前道歉。

答案2

这可能是因为存档源中心。最好在系统设置中检查更新和支持,或者更改日期和时区。

答案3

将 /etc/apt/sources.list 中的每个 tr.archive.ubuntu.com 更改为 de.archive.ubuntu.com。

tr(土耳其的 Alpha-2 代码) de(德国的 2 个 Alpha-2 代码)

答案4

自从我从葡萄牙搬来后,我的 Ubuntu 22.04 也遇到了同样的问题,所以我去了那里:

活动/软件更新

然后我选择其他并选择最佳服务器。Ubuntu 将测试您所在位置的更新服务器并选择性能最佳的服务器。

享受。

相关内容