When I run the command sudo apt-get install vnc4server in ubuntu 20’s terminal, I get the error message E: Package ‘vnc4server’ has no installation candidate. This article will tell you how to fix it.
1. How To Reproduce The Error.
- Open a terminal in Ubuntu, my Ubuntu version is 20.04.3.
- Input the command sudo apt-get install vnc4server and press enter to run it.
- Then it will show the below error messages.
$ sudo apt-get install vnc4server [sudo] password for jerry: Reading package lists... Done Building dependency tree Reading state information... Done Package vnc4server 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 'vnc4server' has no installation candidate
2. How To Fix The Error E: Package ‘vnc4server’ has no installation candidate.
- Open a web browser and browse Ubuntu Packages Search.
- Scroll down to the Search section.
- Input vnc4server in the Keyword input text box.
- Select any in the Distribution drop-down list.
- Click the Search button to search.
- Then it will show the search result as below.
Package vnc4server bionic (18.04LTS) (x11): Virtual network computing server software [universe] 4.1.1+xorg4.3.0-37.3ubuntu2: amd64 arm64 armhf i386 ppc64el s390x
- From the above result, we can see that the vnc4server software is in the bionic version and belongs to the universe repository.
- Now we can run the command sudo vim /etc/apt/sources.list to edit the sources.list file.
- Add the below line in the file and save it.
deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe
- Now run the command sudo apt-get update to update the ubuntu packages from the bionic version.
- Restart the Ubuntu OS, now you can install the vnc4server successfully as below.
$ sudo apt-get install vnc4server [sudo] password for jerry: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: xbase-clients Suggested packages: vnc-java x11-xfs-utils The following NEW packages will be installed: vnc4server xbase-clients 0 upgraded, 2 newly installed, 0 to remove and 170 not upgraded. Need to get 1,626 kB of archives. After this operation, 5,517 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 xbase-clients all 1:7.7+19ubuntu14 [4,184 B] Get:2 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 vnc4server amd64 4.1.1+xorg4.3.0-37.3ubuntu2 [1,622 kB] Fetched 1,626 kB in 3s (522 kB/s) Selecting previously unselected package xbase-clients. (Reading database ... 167090 files and directories currently installed.) Preparing to unpack .../xbase-clients_1%3a7.7+19ubuntu14_all.deb ... Unpacking xbase-clients (1:7.7+19ubuntu14) ... Selecting previously unselected package vnc4server. Preparing to unpack .../vnc4server_4.1.1+xorg4.3.0-37.3ubuntu2_amd64.deb ... Unpacking vnc4server (4.1.1+xorg4.3.0-37.3ubuntu2) ... Setting up xbase-clients (1:7.7+19ubuntu14) ... Setting up vnc4server (4.1.1+xorg4.3.0-37.3ubuntu2) ... update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode update-alternatives: using /usr/bin/Xvnc4 to provide /usr/bin/Xvnc (Xvnc) in auto mode update-alternatives: using /usr/bin/x0vnc4server to provide /usr/bin/x0vncserver (x0vncserver) in auto mode update-alternatives: using /usr/bin/vnc4passwd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode update-alternatives: using /usr/bin/vnc4config to provide /usr/bin/vncconfig (vncconfig) in auto mode Processing triggers for man-db (2.9.1-1) ...