problem adding a repository

Asked by John Wilson

Trying to add a repository using add-apt-repository and get an error message
Here is the output:
ohn@john-K52Jc:~$ sudo add-apt-repository http://ppa.launchpad.net/opencpn/opencpn/ubuntu raring
Error: need a single repository as argument
Where is my syntax wrong?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
John Wilson
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Raring is EOL and no longer supported in any way. It is EOL. I suggest you wipe Raring off the system and do a clean install of Trusty which is LTS and supported til April 2019.

You can add a PPA with:

sudo add-apt-repository ppa:opencpn/opencpn

You need the bold PPA link from the PPA page.

Thanks

Revision history for this message
John Wilson (jwilsondmartin) said :
#2

Thanks for your help
I upgraded to Trusty when it was released.
Still having the error message about requiring a single repository when I used the OpenCPN commands.
With your command this is what happended:
john@john-K52Jc:~$ sudo add-apt-repository http://ppa.launchpad.net/opencpn/opencpn/ubuntu trusty main
Error: need a single repository as argument
john@john-K52Jc:~$ sudo add-apt-repository ppa:opencpn/opencpn
 A Chartplotter and GPS Navigation Software.

OpenCPN is a free software (GPLv2) project to create a concise chartplotter and navigation software for use as an underway or planning tool. OpenCPN is developed by a team of active sailors using real world conditions for program testing and refinement.
 More info: https://launchpad.net/~opencpn/+archive/ubuntu/opencpn
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpp938icy5/secring.gpg' created
gpg: keyring `/tmp/tmpp938icy5/pubring.gpg' created
gpg: requesting key C865EB40 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpp938icy5/trustdb.gpg: trustdb created
gpg: key C865EB40: public key "Launchpad PPA for OpenCPN" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
john@john-K52Jc:~$ opencpn
opencpn: error while loading shared libraries: libwx_baseu-2.8.so.0: cannot open shared object file: No such file or directory

What next?
John

Revision history for this message
Miguel Guse (gusemiguel) said :
#3

Did you check if libwxbase2.8-0 is installed?
try to install it with

sudo apt-get install libwxbase2.8-0

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

For the repository syntax see https://help.ubuntu.com/community/Repositories/CommandLine#Adding_Repositories

The command most probably should have been

sudo add-apt-repository "http://ppa.launchpad.net/opencpn/opencpn/ubuntu trusty main"

with quotes around the whole repository information.

( or sudo add-apt-repository ppa:opencpn/opencpn as already done.)

Revision history for this message
John Wilson (jwilsondmartin) said :
#5

Thank you Miguel and Manfred
libwxbase2.8-0 was not installed and has been added
Then I ran sudo add-apt-repository and seemed to download it:
john@john-K52Jc:~$ sudo add-apt-repository ppa:opencpn/opencpn
 A Chartplotter and GPS Navigation Software.

OpenCPN is a free software (GPLv2) project to create a concise chartplotter and navigation software for use as an underway or planning tool. OpenCPN is developed by a team of active sailors using real world conditions for program testing and refinement.
 More info: https://launchpad.net/~opencpn/+archive/ubuntu/opencpn
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmptcvhjrdc/secring.gpg' created
gpg: keyring `/tmp/tmptcvhjrdc/pubring.gpg' created
gpg: requesting key C865EB40 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmptcvhjrdc/trustdb.gpg: trustdb created
gpg: key C865EB40: public key "Launchpad PPA for OpenCPN" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK

I now have an icon in unity but it does not run and when I use the terminal here is the result:
john@john-K52Jc:~$ opencpn
opencpn: error while loading shared libraries: libwx_gtk2u_core-2.8.so.0: cannot open shared object file: No such file or directory

How do I install OpenCPN from here?

Revision history for this message
Miguel Guse (gusemiguel) said :
#6

Again there seems to be a missing library. You could try to install it by running "sudo apt-get install libwxgtk2.8-0", but probably there are more missing libraries.
After adding the repository, did you install OpenCPN running "sudo apt-get install opencpn"? Normaly this should install all necessary libraries too.

Revision history for this message
Miguel Guse (gusemiguel) said :
#7

I did a little research and just realized that there is no package for Ubuntu 14.04 Trusty in the repository.

Thus, you should install OpenCPN via the .deb package available on

http://opencpn.org/ocpn/download

Also have a look at

http://opencpn.org/ocpn/installing_opencpn

under the Linux paragraph there are detailed instructions on how to install it, and even on how to install the needed dependencies(!).

If you already installed OpenCPN in some way, but are only missing the dependencies (as running "opencpn" gives you an output), just run the commands given on the OpenCPN Installation site:

"sudo gdebi <downloaded_opencpn_file.deb>" (if you installed a .deb package)

or

"sudo apt-get install libwxgtk2.8-0 libwxbase2.8-0 wx-common libglu1-mesa libgl1-mesa-glx zlib1g bzip2 gpsd gpsd-clients xcalib xdg-utils libportaudio2 libkml0 libtinyxml2.6.2 liburiparser1 zlib1g libexpat1"

Also you may want to remove the ppa from your sources list, as it will only give errors when you update.
For this run "sudo add-apt-repository --remove ppa:opencpn/opencpn"

I hope this will help!

Revision history for this message
John Wilson (jwilsondmartin) said :
#8

Hi Miguel
Ran sudo apt-get install libwxgtk2.8-0 and installed some stuff and then sudo apt-get install opencpn
Here is the output:
john@john-K52Jc:~$ sudo apt-get install libwxgtk2.8-0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpostproc52 linux-headers-3.13.0-24 linux-headers-3.13.0-24-generic
  linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  libwxgtk2.8-0
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 2,340 kB of archives.
After this operation, 8,897 kB of additional disk space will be used.
Get:1 http://mirrors.us.kernel.org/ubuntu/ trusty/universe libwxgtk2.8-0 i386 2.8.12.1+dfsg-2ubuntu2 [2,340 kB]
Fetched 2,340 kB in 3s (711 kB/s)
Selecting previously unselected package libwxgtk2.8-0:i386.
(Reading database ... 289142 files and directories currently installed.)
Preparing to unpack .../libwxgtk2.8-0_2.8.12.1+dfsg-2ubuntu2_i386.deb ...
Unpacking libwxgtk2.8-0:i386 (2.8.12.1+dfsg-2ubuntu2) ...
Setting up libwxgtk2.8-0:i386 (2.8.12.1+dfsg-2ubuntu2) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
john@john-K52Jc:~$ sudo apt-get install opencpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package opencpn 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 'opencpn' has no installation candidate
john@john-K52Jc:~$

I don't think I installed all of the repository for when I run sudo add-apt-repository here is the output:
john@john-K52Jc:~$ sudo add-apt-repository http://ppa.launchpad.net/opencpn/opencpn/ubuntu trusty main
Error: need a single repository as argument

How do I get a single repository as argument?

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#9

You were trying the wrong PPA.

Please run these Terminal commands instead:

sudo add-apt-repository ppa:nohal/opencpn

sudo apt-get update

sudo apt-get install opencpn

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

I expect that the commands given by Mark will help.

I just want to add some background information that might shed some light on what was going wrong here:

1. The command add-apt-repository needs just one single argument, either in the form ppa:user/ppa-name or in the form "http://sourceserver/directory/ubuntu release bucket" WITH QUOTES AROUND. This makes it "a single repository". (See my comment in response #4)

2. Just adding a repository server with the add-apt-repository command is not enough. This only adds the server to the list of repositories, but does not download anything yet. You need to execute "sudo apt-get update" (or use the reload button in software-center or synaptic) to pull in the information about the repository's contents. Only after doing that, the commands to install or upgrade software will also look in that repository.

3. You seem to have mixed the commands to build and install opencpn from source with attempts to install pre-built packages from Ubuntu repositories. This might fail (and apparently has failed with "error while loading shared libraries").
If you stick to .dev packages installed with apt-get commands or via software-center or synaptic or gdebi, then the dependencies will be automatically be taken care of.
If you try downloading the source and building the executable yourself, then you have to make sure by yourself, that all dependencies are satisfied (e.g. see the instructions in the link to opencpn.org given by Miguel).

4. I found two PPAs on Launchpad with opencpn software https://launchpad.net/ubuntu/+ppas?name_filter=opencpn The second one (ppa:opencpn/opencpn) has that software only for the Ubuntu releases up to raring. The first one (ppa:nohal/opencpn) has also software for trusty. So you should remove the opencpn one and add nohal one with the commands already given by Miguel and Mark.

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

And another thing:

The output
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded
of the apt-get install command shows that not all packages on your system are fully up-to-date.

You should either issue the commands
sudo apt-getupdate
sudo apt-get upgrade
or start update-manager to upgrade all your packages to the latest version.

Revision history for this message
John Wilson (jwilsondmartin) said :
#12

Thank you so much for your help.
With Mark's commands in response #9 I am able to do a clean installation on my desktop and the new version of OpenCPN looks different to what I am stuck with on my laptop where my boat languishes where it was two years ago.
What I think I need to do now is a complete removal of all versions of OpenCPN but it does not show up on Synaptic and removing it with the Ubuntu Software centre is not effective enough
What do you suggest?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#13

What is the output of :

lsb_release -a; uname -a; apt-cache policy opencpn

Thanks

Revision history for this message
John Wilson (jwilsondmartin) said :
#14

john@john-K52Jc:~$ lsb_release -a; uname -a; apt-cache policy opencpn
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
Linux john-K52Jc 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:43:42 UTC 2014 i686 i686 i686 GNU/Linux
opencpn:
  Installed: 3.3.1825-0~trusty2
  Candidate: 3.3.1825-0~trusty2
  Version table:
 *** 3.3.1825-0~trusty2 0
        500 http://ppa.launchpad.net/nohal/opencpn/ubuntu/ trusty/main i386 Packages
        100 /var/lib/dpkg/status
john@john-K52Jc:~$

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#15

http://www.cruisersforum.com/forums/f134/

They have a forum, maybe they can help.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#16

http://www.cruisersforum.com/forums/f134/

They have a forum, maybe they can help.

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

Hints for removing all versions of opencpn (with the aim to do a clean installation afterwards):

1. to remove the Ubuntu version:
sudo dpkg --purge opencpn

2. to check whether there are opencpn files elsewhere on your system:
sudo updatedb
locate opencpn

Please copy/paste all output as done before

Revision history for this message
John Wilson (jwilsondmartin) said :
#18

Thank you all for your help.
Sowmehow I have got the old version of OpenCPN to talk to the GPS so that it is functioning.
Have run out of time as I am going cruising.
Will work on the problem when I get back
John