2

I am a newbie with Ubuntu. I am trying to install GTK3 on my machine running Ubuntu 18.04.2 LTS.

I use the following command: sudo apt install libgtk-3-dev

I have tried several times and I get following response

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
 libatk-bridge2.0-dev libatspi2.0-dev libepoxy-dev libxtst-dev wayland-protocols x11proto-record-dev
Suggested packages:
 libgtk-3-doc
The following NEW packages will be installed:
 libatk-bridge2.0-dev libatspi2.0-dev libepoxy-dev libgtk-3-dev libxtst-dev wayland-protocols x11proto-record-dev
 0 upgraded, 7 newly installed, 0 to remove and 24 not upgraded.
 Need to get 897 kB/1,145 kB of archives.
 After this operation, 13.9 MB of additional disk space will be used.
 Do you want to continue? [Y/n] Y
Err:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgtk-3-dev amd64 3.22.30-1ubuntu3
 404  Not Found [IP: 91.189.91.24 80]
 E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+3.0/libgtk-3-dev_3.22.30-1ubuntu3_amd64.deb  404  Not Found [IP: 91.189.91.24 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Can anyone please assist.

Thank you in advance.

3
  • 1
    Have you tried to do a sudo apt update then sudo apt upgrade then try your command again ?
    – Saxtheowl
    Oct 2, 2019 at 20:21
  • 1
    Yes I have tried the sudo apt update and sudo apt upgrade.... things go successfully but in the end I get E: Failed to fetch messages Oct 2, 2019 at 20:31
  • us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+3.0 contains the file: libgtk-3-dev_3.22.30-1ubuntu4_amd64.deb (dated: 2018-04-17 07:52, 876K) which is a newer version of the archive file 1ubuntu3_amd64.deb that failed to fetch. Also there are different versions available depending on what you need to install on your particular system. A package manager such as Synaptic, after updating sources, probably would catch this automatically. Oct 24, 2019 at 9:32

2 Answers 2

1

As noted at https://itsfoss.com/ppa-guide/ "A repository is a collection of files that has information about various software, their versions and some other details like the checksum. Each Ubuntu version has its own official set of four repositories:

Main – Canonical-supported free and open-source software.
Universe – Community-maintained free and open-source software.
Restricted – Proprietary drivers for devices.
Multiverse – Software restricted by copyright or legal issues.

So basically it’s a web URL that has information about the software. How does your system know where are these repositories? This information is stored in the sources.list file in the directory /etc/apt. If you look at its content, you’ll see that it has the URL of the repositories. The lines with # at the beginning are ignored.

"Now when you run the command sudo apt update (then sudo apt upgrade), your system uses APT tool to check against the repo and stores the information about the software and their version in a cache. When you use the command sudo apt install package_name, it uses the information to get that package from the URL where the actual software is stored."

The 404 error you found shows the web address in your /etc/apt/sources.list is out of date; there isn't a directory at http://us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+3.0/ with the file libgtk-3-dev_3.22.30-1ubuntu3_amd64.deb in the server at 91.189.91.24.

You need to run sudo apt update && sudo apt upgrade before you try again to update the list inside your Ubuntu of what packages are where.

Should those fail, problems most likely are:

  • trying to install a package no longer available in the repositories (almost always replaced by a newer package with a sightly different name), or
  • the list of repositories in /etc/apt/sources.list is out of date, or
  • the Internet connection to the repositories is down.
1
  • Thank you for your answer. I did the sudo apt update and sudo pt upgrade and re-issued the sudo apt install libgtk-3-dev. I still get Fetch errors like Err:1 us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgtk-3-dev amd64 3.22.30-1ubuntu3 404 Not Found [IP: 91.189.91.23 80] E: Failed to fetch us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+3.0/… 404 Not Found [IP: 91.189.91.23 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Oct 2, 2019 at 20:44
0

Why are you installing the dev (development) files? You don't need those as a user. That's for creation of new programs. Ubuntu 18.04 should already work with GTK3, all the packages are included. You should already have a package installed (with proper dependencies) called libgtk-3-0. If you are a developer, you'll want to install dev files that work with your particular system, if you're using say KDE (kubuntu) or Xfce (Xubuntu) or a particular development environment such as Unity, Go, Github, etc. All the bindings for other programs should also already be installed, unless you're showing broken dependencies, which isn't likely. (edit) you also don't need the doc files (documentation) unless you're planning to say, rewrite your system! It might be easier, rather than using terminal, to check out what you have installed using say, Synaptic (which does a lot of the work for you discovering what's on your system and what's available that you might want.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .