LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bodhi (https://www.linuxquestions.org/questions/bodhi-92/)
-   -   Problems when trying to add a ppa (https://www.linuxquestions.org/questions/bodhi-92/problems-when-trying-to-add-a-ppa-4175655133/)

Rosika 06-04-2019 10:33 AM

Problems when trying to add a ppa
 
Hi altogether,

I use Bodhi Linux in a VM. These are the specs:

Code:

uname -a
Linux rosika-virtual-machine 4.8.0-34-generic #36~16.04.1-Ubuntu SMP Wed Dec 21 18:54:55 UTC 2016 i686 i686 i686 GNU/Linux

The system should be up-to-date as Iīve performed an update just now.

I use firejail but the version of the repository is pretty much outdated. So I wanted to add:

Code:

sudo add-apt-repository ppa:deki/firejail
in the terminal.
But here I encountered a problem. Terminal says:

Code:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortc
ut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py"
, line 27, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-i386-linux-gnu.s
o: symbol _ZN9pkgSystem9LockInnerEv, version APTPKG_5.0 not defined in file liba
pt-pkg.so.5.0 with link time reference
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in appor
t_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-i386-linux-gnu.so: symbol _ZN9pkgSystem9LockInnerEv, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-i386-linux-gnu.so: symbol _ZN9pkgSystem9LockInnerEv, version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

I donīt know what to make of it and how to remedy the situation.

Can anyone help?

Tnx a lot in advance.

Greetings
Rosika :confused:

rbtylee 06-04-2019 12:46 PM

That is certainly a mess.

Officially Bodhi does not recommend the usage of PPAs. Unless of course you know what you are doing.

As to the issue, I would think you have some sort of package conflicts going on here. You probably have the wrong versions of some important packages installed, however it happened. Now this is just a semi educated guess based on the error message posted above.

[You are probably using BL 4.5 so skip this if so ... See comment below]

Note I am going to assume you are using Bodhi 5.0, if not tell me:

So first thing I would try is

Code:

sudo apt-get --reinstall install libapt-pkg5.0

rbtylee 06-04-2019 04:27 PM

OK, I have found out this is a known Bodhi linux 4.5 issue.

So assuming you are using bodhi linux 4.x and a system update has broken add-apt-repository. This is not your fault it is a package conflict with Bodhi 4.5 modified version of apt and the version of apt and python-apt stuff you updated to.

Bodhi 5.0 users are not going to have this issue.

Open synaptic and Force and lock the versions of these three packages: apt apt-util and libapt-pkg5.0. I used version 1.2.31 on all three. Now add-apt-repository should work.

I could fix this in Bodhi 4.5 repos but officially we no longer support BL 4.5 and advise users to update to BL 5.x.

OK One more thing to note: Lock version in synaptic doesn't work correctly in BL 4.x. This one is a Ubuntu issue. But note do not let apt-get update update the three packages above you forced the version of. Or if you do redo this process.

Rosika 06-05-2019 07:20 AM

Hello rbtylee,

thank you so much for yor help. It worked!!!!!! Youīre a genius. :hattip:

First of all itīs comforting to know that I didnīt bring about the issue myself. I was already beginning to wonder.....

Then I did what you suggested:

Quote:

Open synaptic and Force and lock the versions of these three packages: apt apt-util and libapt-pkg5.0. I used version 1.2.31 on all three. Now add-apt-repository should work.
And it really did work!

I could add the respective repository with
Code:

sudo add-apt-repository ppa:deki/firejail
without any difficulties. After that I wanted to upgrade to the latest version of firejail (0.9.60-1~0ubuntu16.04.0).
At first the package was held back. Then I decided to go for "sudo apt-get dist-upgrade". That one worked perfectly and I now have the latest firejail-version.

So thanks again for your valuable help. I appreciate it very much.

Greetings.
Rosika :)

P.S.:

I could never figure out what BL-version I have. The only info I got is:

Code:

uname -a
Linux rosika-virtual-machine 4.8.0-34-generic #36~16.04.1-Ubuntu SMP Wed Dec 21 18:54:55 UTC 2016 i686 i686 i686 GNU/Linux

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Bodhi Linux
Release:        16.04
Codename:      xenial

But what that translates to I really cannot say.

rbtylee 06-05-2019 09:27 AM

Thanks and glad it worked :D

Quote:

Originally Posted by Rosika (Post 6002370)
...
I could never figure out what BL-version I have. The only info I got is:
...

The simplest thing to do is open About Bodhi in the Menu. It tells the Bodhi version on the toolbar prob placed at the top and to the right. That is prob theme dependant tho, but the version should be there. If you are using a broken theme and it is not there switch to the default theme and it will be there.

Rosika 06-05-2019 09:38 AM

Hi rbtylee,

thanks for getting back with the added information.

To my shame I have to admit that Iīve never used "About Bodhi".:redface:
I just did and thus I can confirm: my version is 4.5.0.

Glad I know that as well now.

Tnx again and have a nice day.

Greetings.
Rosika :)

the_waiter 06-05-2019 11:31 AM

Hello there

Nice your issue has been solved.

I would also encourage you to install BL 5.0 as the repository is fully supported. Also you will be ready for upcoming BL 5.1 upgrade with hundreds of Moksha stability and security patches and new Bodhi features which are missing in BL 4.x

Stefan

madmax25 06-06-2019 11:38 AM

When you force and lock packages, you should "hold" them as well.
Otherwise they will be updated when you use the terminal for your next system updates.

Here's how you hold packages:

Code:

sudo apt-mark hold
followed by the name(s) of the wanted package(s).

To remove the "hold", just use the same command, but replace hold with unhold.

Rosika 06-07-2019 07:13 AM

@madmax25,

thanks for the hint.

In fact I already noticed that force and lock wonīt suffice by themselves.
As you said, after triggring an update/upgrade the respective packages will be updated. I set "sudo apt-mark hold" for them - as you suggested. Now it works perfectly fine. :)

Another thing I have learnt now in this fantastic Linux world.

Thanks a lot again and have a nice day.

Greetings.
Rosika :hattip:

Rosika 06-07-2019 07:23 AM

@the_waiter:

Hi Stefan,


Quote:

I would also encourage you to install BL 5.0
Thanks for the suggestion. It certainly seems like a worthwhile step.

Yet I first have to "save up" for getting the ISO.
The thing is: My sole medium for internet-connection is a UMTS-stick which gives me 6 GB per month (or rather: 4 weeks). That translates roughly into 207 MB per day.

But Iīll certainly get BL 5.0 as I deem it a wonderful OS.

Thanks and have a nice day.

Greetings.
Rosika :)

the_waiter 06-07-2019 08:19 AM

Enjoy :)


All times are GMT -5. The time now is 11:07 PM.