Ubuntu error: unable to locate package libqt5websockets5-dev : Solution

Written by Administrator on Tuesday May 12, 2020

In case you're running Ubuntu USB live distro and trying to install  libqt5websockets5 or libqt5websockets5-dev package and your Ubuntu system cannont find it:

$ sudo apt install libqt5websockets
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libqt5websockets

In case you are going to install libqt5websockets5 package, system will fail to do it and will show you following error in terminal:

$ sudo apt install libqt5websockets5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libqt5websockets5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'libqt5websockets5' has no installation candidate

it surely means that you are missing official Ubuntu repositories.

Solution

Solution is very simple and easy: add (activate) needed repository:

$ sudo add-apt-repository universe

Universe is a Ubuntu repository, where you can find many valuable program packages.

Then you can try to install libqt5websockets package again and meet success:

$ sudo apt-get install libqt5websockets5-dev

My output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libegl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libqt5concurrent5
  libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5
  libqt5opengl5-dev libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite
  libqt5test5 libqt5widgets5 libqt5xml5 libwayland-bin libwayland-client0
  libwayland-cursor0 libwayland-dev libwayland-egl1 libwayland-server0
  qt5-gtk-platformtheme qt5-qmake qt5-qmake-bin qtbase5-dev qtbase5-dev-tools
  qtchooser
Suggested packages:
  qt5-image-formats-plugins qtwayland5 libwayland-doc
  default-libmysqlclient-dev firebird-dev libpq-dev libsqlite3-dev
  unixodbc-dev
The following NEW packages will be installed:
  libegl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libqt5concurrent5
  libqt5opengl5 libqt5opengl5-dev libqt5printsupport5 libqt5sql5
  libqt5sql5-sqlite libqt5test5 libqt5websockets5-dev libqt5xml5
  libwayland-bin libwayland-dev qt5-qmake qt5-qmake-bin qtbase5-dev
  qtbase5-dev-tools qtchooser
The following packages will be upgraded:
  libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5widgets5
  libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0
  qt5-gtk-platformtheme
10 upgraded, 19 newly installed, 0 to remove and 184 not upgraded.
Need to get 11.7 MB of archives.
After this operation, 27.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libegl1-mesa-dev amd64 19.2.8-0ubuntu0~18.04.3 [20.3 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-client0 amd64 1.16.0-1ubuntu1.1~18.04.3 [23.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgles2-mesa-dev amd64 19.2.8-0ubuntu0~18.04.3 [44.8 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libglu1-mesa-dev amd64 9.0.0-2.1build1 [206 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-server0 amd64 1.16.0-1ubuntu1.1~18.04.3 [29.6 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-cursor0 amd64 1.16.0-1ubuntu1.1~18.04.3 [10.1 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-egl1 amd64 1.16.0-1ubuntu1.1~18.04.3 [5,464 B]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-bin amd64 1.16.0-1ubuntu1.1~18.04.3 [19.8 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libwayland-dev amd64 1.16.0-1ubuntu1.1~18.04.3 [62.8 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/main amd64 qtchooser amd64 64-ga1b6736-5 [24.1 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libqt5websockets5-dev amd64 5.9.5-0ubuntu1 [9,996 B]
Get:12 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5core5a amd64 5.9.5+dfsg-0ubuntu2.5 [2,036 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5concurrent5 amd64 5.9.5+dfsg-0ubuntu2.5 [29.8 kB]
Get:14 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5dbus5 amd64 5.9.5+dfsg-0ubuntu2.5 [195 kB]
Get:15 http://security.ubuntu.com/ubuntu bionic-security/main amd64 qt5-gtk-platformtheme amd64 5.9.5+dfsg-0ubuntu2.5 [117 kB]
Get:16 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5network5 amd64 5.9.5+dfsg-0ubuntu2.5 [635 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5gui5 amd64 5.9.5+dfsg-0ubuntu2.5 [2,568 kB]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5widgets5 amd64 5.9.5+dfsg-0ubuntu2.5 [2,203 kB]
Get:19 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5opengl5 amd64 5.9.5+dfsg-0ubuntu2.5 [132 kB]
Get:20 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5printsupport5 amd64 5.9.5+dfsg-0ubuntu2.5 [178 kB]
Get:21 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5sql5 amd64 5.9.5+dfsg-0ubuntu2.5 [115 kB]
Get:22 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5test5 amd64 5.9.5+dfsg-0ubuntu2.5 [98.1 kB]
Get:23 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5xml5 amd64 5.9.5+dfsg-0ubuntu2.5 [99.5 kB]
Get:24 http://security.ubuntu.com/ubuntu bionic-security/main amd64 qt5-qmake-bin amd64 5.9.5+dfsg-0ubuntu2.5 [938 kB]
Get:25 http://security.ubuntu.com/ubuntu bionic-security/main amd64 qt5-qmake amd64 5.9.5+dfsg-0ubuntu2.5 [180 kB]
Get:26 http://security.ubuntu.com/ubuntu bionic-security/main amd64 qtbase5-dev-tools amd64 5.9.5+dfsg-0ubuntu2.5 [724 kB]
Get:27 http://security.ubuntu.com/ubuntu bionic-security/main amd64 qtbase5-dev amd64 5.9.5+dfsg-0ubuntu2.5 [943 kB]
Get:28 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5opengl5-dev amd64 5.9.5+dfsg-0ubuntu2.5 [36.1 kB]
Get:29 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libqt5sql5-sqlite amd64 5.9.5+dfsg-0ubuntu2.5 [40.2 kB]
Fetched 11.7 MB in 1min 51s (106 kB/s)                                         
(Reading database ... 147342 files and directories currently installed.)
Preparing to unpack .../00-libwayland-client0_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-client0:amd64 (1.16.0-1ubuntu1.1~18.04.3) over (1.16.0-1ubuntu1.1~18.04.1) ...
Preparing to unpack .../01-libwayland-server0_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-server0:amd64 (1.16.0-1ubuntu1.1~18.04.3) over (1.16.0-1ubuntu1.1~18.04.1) ...
Preparing to unpack .../02-libwayland-cursor0_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-cursor0:amd64 (1.16.0-1ubuntu1.1~18.04.3) over (1.16.0-1ubuntu1.1~18.04.1) ...
Preparing to unpack .../03-libwayland-egl1_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-egl1:amd64 (1.16.0-1ubuntu1.1~18.04.3) over (1.16.0-1ubuntu1.1~18.04.1) ...
Selecting previously unselected package libwayland-bin.
Preparing to unpack .../04-libwayland-bin_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-bin (1.16.0-1ubuntu1.1~18.04.3) ...
Selecting previously unselected package libwayland-dev:amd64.
Preparing to unpack .../05-libwayland-dev_1.16.0-1ubuntu1.1~18.04.3_amd64.deb ...
Unpacking libwayland-dev:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Selecting previously unselected package libegl1-mesa-dev:amd64.
Preparing to unpack .../06-libegl1-mesa-dev_19.2.8-0ubuntu0~18.04.3_amd64.deb ...
Unpacking libegl1-mesa-dev:amd64 (19.2.8-0ubuntu0~18.04.3) ...
Selecting previously unselected package libgles2-mesa-dev:amd64.
Preparing to unpack .../07-libgles2-mesa-dev_19.2.8-0ubuntu0~18.04.3_amd64.deb ...
Unpacking libgles2-mesa-dev:amd64 (19.2.8-0ubuntu0~18.04.3) ...
Selecting previously unselected package libglu1-mesa-dev:amd64.
Preparing to unpack .../08-libglu1-mesa-dev_9.0.0-2.1build1_amd64.deb ...
Unpacking libglu1-mesa-dev:amd64 (9.0.0-2.1build1) ...
Preparing to unpack .../09-libqt5core5a_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Selecting previously unselected package libqt5concurrent5:amd64.
Preparing to unpack .../10-libqt5concurrent5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5concurrent5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Preparing to unpack .../11-libqt5dbus5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5dbus5:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Preparing to unpack .../12-qt5-gtk-platformtheme_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking qt5-gtk-platformtheme:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Preparing to unpack .../13-libqt5network5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5network5:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Preparing to unpack .../14-libqt5gui5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5gui5:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Preparing to unpack .../15-libqt5widgets5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5widgets5:amd64 (5.9.5+dfsg-0ubuntu2.5) over (5.9.5+dfsg-0ubuntu2.4) ...
Selecting previously unselected package libqt5opengl5:amd64.
Preparing to unpack .../16-libqt5opengl5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5opengl5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5printsupport5:amd64.
Preparing to unpack .../17-libqt5printsupport5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5printsupport5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5sql5:amd64.
Preparing to unpack .../18-libqt5sql5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5sql5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5test5:amd64.
Preparing to unpack .../19-libqt5test5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5test5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5xml5:amd64.
Preparing to unpack .../20-libqt5xml5_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5xml5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package qt5-qmake-bin.
Preparing to unpack .../21-qt5-qmake-bin_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking qt5-qmake-bin (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package qtchooser.
Preparing to unpack .../22-qtchooser_64-ga1b6736-5_amd64.deb ...
Unpacking qtchooser (64-ga1b6736-5) ...
Selecting previously unselected package qt5-qmake:amd64.
Preparing to unpack .../23-qt5-qmake_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking qt5-qmake:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package qtbase5-dev-tools.
Preparing to unpack .../24-qtbase5-dev-tools_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking qtbase5-dev-tools (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package qtbase5-dev:amd64.
Preparing to unpack .../25-qtbase5-dev_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking qtbase5-dev:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5opengl5-dev:amd64.
Preparing to unpack .../26-libqt5opengl5-dev_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5opengl5-dev:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5sql5-sqlite:amd64.
Preparing to unpack .../27-libqt5sql5-sqlite_5.9.5+dfsg-0ubuntu2.5_amd64.deb ...
Unpacking libqt5sql5-sqlite:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Selecting previously unselected package libqt5websockets5-dev:amd64.
Preparing to unpack .../28-libqt5websockets5-dev_5.9.5-0ubuntu1_amd64.deb ...
Unpacking libqt5websockets5-dev:amd64 (5.9.5-0ubuntu1) ...
Setting up libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libwayland-bin (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up libglu1-mesa-dev:amd64 (9.0.0-2.1build1) ...
Setting up libqt5dbus5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5network5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up qt5-qmake-bin (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libwayland-client0:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up qtchooser (64-ga1b6736-5) ...
Setting up libqt5test5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up qt5-qmake:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5xml5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5gui5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5sql5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up qt5-gtk-platformtheme:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libwayland-cursor0:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up libqt5concurrent5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libwayland-egl1:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up libwayland-server0:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up qtbase5-dev-tools (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5widgets5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5printsupport5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5opengl5:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5sql5-sqlite:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libwayland-dev:amd64 (1.16.0-1ubuntu1.1~18.04.3) ...
Setting up libegl1-mesa-dev:amd64 (19.2.8-0ubuntu0~18.04.3) ...
Setting up libgles2-mesa-dev:amd64 (19.2.8-0ubuntu0~18.04.3) ...
Setting up qtbase5-dev:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Setting up libqt5websockets5-dev:amd64 (5.9.5-0ubuntu1) ...
Setting up libqt5opengl5-dev:amd64 (5.9.5+dfsg-0ubuntu2.5) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...