无法安装 libgtk2.0-dev - sudo apt-get update 问题

无法安装 libgtk2.0-dev - sudo apt-get update 问题

我正在使用以下操作系统版本:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

当我运行时sudo apt-get update,我收到以下消息:

Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                                                      
Hit:3 http://dl.google.com/linux/chrome/deb stable Release                                                                                                                                                        
Ign:1 https://dl.bintray.com/etcher/debian stable InRelease                                                                                                                                                       
Hit:7 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                                         
Get:6 https://dl.bintray.com/etcher/debian stable Release [3,674 B]                                                
Hit:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease                                                                            
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                    
Get:10 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                             
Hit:11 https://release.memsql.com/production/debian memsql InRelease                                                                                                   
Hit:12 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease                                                                           
Hit:4 https://packagecloud.io/github/git-lfs/ubuntu bionic InRelease                                                                               
Ign:14 http://us.archive.ubuntu.com/ubuntu bionic/universe arm64 Packages
Ign:15 http://us.archive.ubuntu.com/ubuntu bionic/main arm64 Packages
Ign:14 http://us.archive.ubuntu.com/ubuntu bionic/universe arm64 Packages
Ign:15 http://us.archive.ubuntu.com/ubuntu bionic/main arm64 Packages
Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [652 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Ign:14 http://us.archive.ubuntu.com/ubuntu bionic/universe arm64 Packages                     
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]     
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]     
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]     
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages [580 kB]
Ign:15 http://us.archive.ubuntu.com/ubuntu bionic/main arm64 Packages       
Ign:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages                  
Ign:28 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages                      
Err:14 http://us.archive.ubuntu.com/ubuntu bionic/universe arm64 Packages                         
  404  Not Found [IP: 91.189.91.38 80]
Ign:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages                  
Ign:15 http://us.archive.ubuntu.com/ubuntu bionic/main arm64 Packages                             
Ign:28 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages                      
Ign:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages  
Ign:28 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages                          
Ign:29 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages                     
Get:30 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,012 kB]
Get:31 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,060 kB]      
Get:32 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [328 kB]
Get:33 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [273 kB]
Get:34 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [204 kB]
Get:35 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [476 kB]
Err:17 http://security.ubuntu.com/ubuntu bionic-security/universe arm64 Packages
  404  Not Found [IP: 91.189.91.39 80]
Get:36 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [892 kB]
Get:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages [641 kB]
Get:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages [641 kB]
Get:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages [641 kB]
Get:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages [641 kB]
Get:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages [641 kB]
Ign:28 http://security.ubuntu.com/ubuntu bionic-security/main arm64 Packages
Ign:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Ign:29 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Ign:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Ign:29 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
Ign:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Err:29 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe arm64 Packages
  404  Not Found [IP: 91.189.91.38 80]
Ign:37 http://us.archive.ubuntu.com/ubuntu bionic-updates/main arm64 Packages
Fetched 181 kB in 2s (89.4 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'etcher/binary-arm64/Packages' as repository 'https://deb.etcher.io stable InRelease' doesn't support architecture 'arm64'
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.91.38 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.91.39 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/binary-arm64/Packages  404  Not Found [IP: 91.189.91.38 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

当我尝试运行命令来安装 gtk 时,sudo apt-get install -y libgtk2.0-dev我收到以下消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autopoint debhelper dh-autoreconf dh-strip-nondeterminism gir1.2-gtk-2.0 gir1.2-harfbuzz-0.0 icu-devtools libarchive-cpio-perl libatk1.0-dev libcairo-script-interpreter2 libcairo2-dev
  libfile-stripnondeterminism-perl libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev libicu-dev
  libicu-le-hb-dev libicu-le-hb0 libiculx60 libmail-sendmail-perl libpango1.0-dev libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-dev libpng-dev libpng-tools libpthread-stubs0-dev libsigsegv2
  libsm-dev libsys-hostname-long-perl libx11-dev libx11-doc libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev
  libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev m4 pkg-config po-debconf x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-fixes-dev x11proto-input-dev
  x11proto-randr-dev x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc dh-make dwz libcairo2-doc libglib2.0-doc libgraphite2-utils libgtk2.0-doc libice-doc icu-doc libpango1.0-doc libsm-doc libxcb-doc libxext-doc m4-doc
  libmail-box-perl
The following NEW packages will be installed:
  autoconf automake autopoint debhelper dh-autoreconf dh-strip-nondeterminism gir1.2-gtk-2.0 gir1.2-harfbuzz-0.0 icu-devtools libarchive-cpio-perl libatk1.0-dev libcairo-script-interpreter2 libcairo2-dev
  libfile-stripnondeterminism-perl libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libgtk2.0-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev
  libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60 libmail-sendmail-perl libpango1.0-dev libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-dev libpng-dev libpng-tools libpthread-stubs0-dev
  libsigsegv2 libsm-dev libsys-hostname-long-perl libx11-dev libx11-doc libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev m4 pkg-config po-debconf x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-fixes-dev
  x11proto-input-dev x11proto-randr-dev x11proto-xext-dev x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev
0 upgraded, 73 newly installed, 0 to remove and 4 not upgraded.
Need to get 1,487 kB/26.0 MB of archives.
After this operation, 120 MB of additional disk space will be used.
Ign:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libglib2.0-dev-bin amd64 2.56.4-0ubuntu0.18.04.4
Ign:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libglib2.0-dev amd64 2.56.4-0ubuntu0.18.04.4
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 libglib2.0-dev-bin amd64 2.56.4-0ubuntu0.18.04.4
  404  Not Found [IP: 91.189.88.142 80]
Err:2 http://us.archive.ubuntu.com/ubuntu bionic-security/main amd64 libglib2.0-dev amd64 2.56.4-0ubuntu0.18.04.4
  404  Not Found [IP: 91.189.88.142 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-dev-bin_2.56.4-0ubuntu0.18.04.4_amd64.deb  404  Not Found [IP: 91.189.88.142 80]
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-dev_2.56.4-0ubuntu0.18.04.4_amd64.deb  404  Not Found [IP: 91.189.88.142 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

作为参考,这是我的/etc/apt/sources.list文件(我最近重置了它以查看是否是这个问题)

deb http://us.archive.ubuntu.com/ubuntu/ bionic universe main
deb http://security.ubuntu.com/ubuntu/ bionic-security universe main
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe main

知道问题是什么吗?这太令人沮丧了。

答案1

我在我的 synaptic 包管理器中搜索,发现那里有 libgtk3.0 版本。我和你有相同的存储库(我使用 Lubuntu 18.04,但来自另一台服务器),所以我建议你从 synapic 包管理器安装 3.0 版本(不是开发版,只有 3.0)。

尽量避免使用 apt-get,这个月我格式化了 SO 近 2 或 3 次,因为我通过终端安装了东西,之后我无法正确删除它们。

如果您需要更多帮助,请随时询问。抱歉,有些话听起来不太好,我不是英语母语人士 :)

PD:你那里也有 libgtk3.0-dev。尝试通过 synaptic 安装它

答案2

在我看来,您的问题应该可以通过重置源来解决。请记住sudo apt update在更改源后运行。

您最初的问题只是版本之间的不匹配。您的系统试图安装镜像在自上次安装以来的几秒/几分钟/几小时内取代的版本sudo apt update

  • 您尝试安装libglib2.0-dev,版本2.56.4-0ubuntu0.18.04.4
  • Ubuntu 存储库中的当前版本是2.56.4-0ubuntu0.18.04.6

通常的解决方案是稍事休息,吃个三明治,然后跑步sudo apt update,然后再次尝试安装。

相关内容