The officially official Devuan Forum!

You are not logged in.

#1 Re: Hardware & System Configuration » I can not run software-properties-kde » 2018-08-25 21:06:44

I discovered the bug concerns Devuan 1 too.

So I suggest this updated script to fix it :

#!/bin/sh
## Bug fix for Devuan1 and Devuan2
## https://dev1galaxy.org/viewtopic.php?pid=11505

if test "$USER" != "root"; then
  echo "This is a bug fix for Devuan1 and Devuan2."
  echo "See: https://dev1galaxy.org/viewtopic.php?pid=11505"
  echo "root user required!"
  exit 1
fi

test -d /usr/share/python-apt/templates || mkdir -pm 755 /usr/share/python-apt/templates

cat > /usr/share/python-apt/templates/Devuan.info << EOF
ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog

Suite: jessie
RepositoryType: deb
BaseURI: http://deb.devuan.org/merged
MatchURI: deb.devuan.org/merged
MirrorsFile: Devuan.mirrors
Description: Devuan 1.0 'jessie'
Component: main
CompDescription: Officially supported
Component: contrib
CompDescription: DFSG-compatible Software with Non-Free Dependencies
Component: non-free
CompDescription: Non-DFSG-compatible Software

Suite: jessie-updates
RepositoryType: deb
ParentSuite: jessie
Description: Recommended updates

Suite: jessie-security
RepositoryType: deb
ParentSuite: jessie
Description: Security updates

Suite: ascii
RepositoryType: deb
BaseURI: http://deb.devuan.org/merged
MatchURI: deb.devuan.org/merged
MirrorsFile: Devuan.mirrors
Description: Devuan 2.0 'ascii'
Component: main
CompDescription: Officially supported
Component: contrib
CompDescription: DFSG-compatible Software with Non-Free Dependencies
Component: non-free
CompDescription: Non-DFSG-compatible Software

Suite: ascii-updates
RepositoryType: deb
ParentSuite: ascii
Description: Recommended updates

Suite: ascii-security
RepositoryType: deb
ParentSuite: ascii
Description: Security updates
EOF

cat > /usr/share/python-apt/templates/Devuan.mirrors << EOF
#LOC:any
http://deb.devuan.org/merged
EOF

echo "Bug fix is done."

#2 Re: Hardware & System Configuration » I can not run software-properties-kde » 2018-08-25 17:57:04

I have just found how to remove the the warning "Failed to read mirror file". In the file Devuan.info, simply replace "MirrorsFile: mirror_list.txt" with "MirrorsFile: Devuan.mirrors".

So my script python-apt-common_template_fix.sh should finally look like that:

#!/bin/sh
## Bug fix for Devuan2
## https://dev1galaxy.org/viewtopic.php?pid=11505

cat > /usr/share/python-apt/templates/Devuan.info << EOF
ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog

Suite: ascii
RepositoryType: deb
BaseURI: http://deb.devuan.org/merged
MatchURI: deb.devuan.org/merged
MirrorsFile: Devuan.mirrors
Description: Devuan 2.0 'ascii'
Component: main
CompDescription: Officially supported
Component: contrib
CompDescription: DFSG-compatible Software with Non-Free Dependencies
Component: non-free
CompDescription: Non-DFSG-compatible Software

Suite: ascii-updates
RepositoryType: deb
ParentSuite: ascii
Description: Recommended updates

Suite: ascii-security
RepositoryType: deb
ParentSuite: ascii
Description: Security updates
EOF

cat > /usr/share/python-apt/templates/Devuan.mirrors << EOF
#LOC:any
http://deb.devuan.org/merged
EOF

#3 Re: Hardware & System Configuration » I can not run software-properties-kde » 2018-08-25 17:43:19

Thanks fsmithred,
The test pass with a not blocking error related to UbuntuDrivers, both with software-properties-gtk and synaptic-pkexec.

I put your fix in a script python-apt-common_template_fix.sh and run it:

#!/bin/sh
cat > /usr/share/python-apt/templates/Devuan.info << EOF
ChangelogURI: http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog

Suite: ascii
RepositoryType: deb
BaseURI: http://deb.devuan.org/merged
MatchURI: deb.devuan.org/merged
MirrorsFile: mirror_list.txt
Description: Devuan 2.0 'ascii'
Component: main
CompDescription: Officially supported
Component: contrib
CompDescription: DFSG-compatible Software with Non-Free Dependencies
Component: non-free
CompDescription: Non-DFSG-compatible Software

Suite: ascii-updates
RepositoryType: deb
ParentSuite: ascii
Description: Recommended updates

Suite: ascii-security
RepositoryType: deb
ParentSuite: ascii
Description: Security updates
EOF

cat > /usr/share/python-apt/templates/Devuan.mirrors << EOF
#LOC:any
http://deb.devuan.org/merged
EOF

Here are the terminal outputs:

demo@fresh_installed_devuan2:~$ gksu software-properties-gtk
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
WARNING: Failed to read mirror file

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:154:27: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:155:26: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:584:27: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:585:28: The style property GtkWidget:interior-focus is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:586:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:587:26: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1344:25: The style property GtkRange:slider-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1345:25: The style property GtkRange:stepper-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1346:34: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1347:28: The style property GtkRange:stepper-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4999): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1348:34: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version
demo@fresh_installed_devuan2:~$ synaptic-pkexec
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
WARNING: Failed to read mirror file

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:154:27: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:155:26: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:584:27: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:585:28: The style property GtkWidget:interior-focus is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:586:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:587:26: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1344:25: The style property GtkRange:slider-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1345:25: The style property GtkRange:stepper-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1346:34: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1347:28: The style property GtkRange:stepper-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(software-properties-gtk:4825): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:1348:34: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version

To remove the warning "Failed to read mirror file", I tried to add a trailing slash to http://deb.devuan.org/merged in Devuan.mirrors, as I believe trailing slashes for sources.list are mentioned in Debian specs. But the warning still remains.
Whatever, I think the bug is fixed! Thanks!

#4 Re: Hardware & System Configuration » I can not run software-properties-kde » 2018-08-25 07:46:16

Thanks golinux for your answer.

I have made many and many checks:
The problem remains the same whatever stands is /etc/apt/sources.list and /etc/apt/sources.list.d/*
I have looked at the python scripts, purged and reinstalled packages, checked system files ownerships and permissions, and watched strace log of synaptic failing to open the repository settings. Nothing found.

Finally, I have searched on the web and found very much similar errors (also in the synaptic debian bug archive), but no real solution.

Someone to "solve" this issue on Linux Mint gave a dirty hard code trick for a python script.

Someone on the ubuntu forum gave a better solution : simply add a file /usr/share/python-apt/templates/Devuan.info.

Can someone on this forum give a "corporate content" for /usr/share/python-apt/templates/Devuan.info?

To clarify, here is the bug I have first found that affect only some of my upgraded machines :
For unknown reason, synaptic fails to open the settings when python3-software-properties is installed on some of my upgraded devuan2 machines, but not on a freshly installed devuan2 from DVD.

Then I found that it concerns all the machines that have software-properties-gtk installed:
With that package, the error output within the terminal is the same, related to a missing file /usr/share/python-apt/templates/Devuan.info

So, everyone can reproduce that bug from a fresh installed devuan2 (mine just have virtualbox additions):

First install software-properties-gtk:

root@fresh_installed_devuan2:~# apt-get -y install software-properties-gtk

Then go crashing python module:

demo@fresh_installed_devuan2:~$ gksu software-properties-gtk
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 109, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Devuan/ascii
demo@fresh_installed_devuan2:~$ synaptic-pkexec 
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 109, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Devuan/ascii

I think this can be solved as easy as creating a good file /usr/share/python-apt/templates/Devuan.info (provided for instance by a postinst script of a package file depending on python-apt-common).

#5 Re: Other Issues » [SOLVED] <Ascii> Devuan Version » 2018-08-24 01:02:17

Hi!

I had the same problem of no-root buggy outputs of lsb_release on my devuan2 real and virtual machines upgraded from devuan1 and debian7.
As I noticed that problem does not concern freshly installed devuan2 machines, I made investigations and... I have just found how to fix it :

chmod 755 /var/lib/apt/lists

---
For information, I share the details of my investigations here:

That bug does not concern fresh installed devuan2 from DVD:

demo@fresh_installed_devuan2:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 2.0 (ascii)
Release:	2.0
Codename:	ascii

But it concerns upgraded devuan2 machines when lsb_release is executed with no root permission:

demo@upgraded_devuan2:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Devuan
Description:    Devuan GNU/Linux ascii
Release:        ascii
Codename:       n/a

Comparison between upgraded and fresh_installed devuan2:
I have compared the base-files package files + the script /usr/bin/lsb_release between my machines, but I found no difference.

Comparison between root and no root execution of lsb_release on an upgraded devuan2:
As /usr/bin/lsb_release imports /usr/lib/python2.7/dist-packages/lsb_release.py, I decided to compare the execution of its function guess_devuan_release() between root and no root execution on an upgraded devuan2:

root@upgraded_devuan2:~# python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
>>> lsb_release.guess_devuan_release()
{'DESCRIPTION': u'Devuan GNU/Linux 2.0 (ascii)', 'RELEASE': u'2.0', 'CODENAME': 'ascii', 'OS': 'GNU/Linux', 'ID': 'Devuan'}
demo@upgraded_devuan2:~$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
>>> lsb_release.guess_devuan_release()
{'RELEASE': 'ascii', 'OS': 'GNU/Linux', 'ID': 'Devuan', 'DESCRIPTION': 'Devuan GNU/Linux ascii'}

Going on deeper within that script, I found out that:

  • /etc/devuan_version remains buggy in devuan2 (ascii instead of 2)

  • Unnoticed indent error: from line #321 to #334 of lsb_release.py (lsb-release 4.1+devuan2), the function guess_devuan_release() uses mixed 2 and 4 spaces indent instead of the 4 ones used in the rest of the script

      rinfo = guess_release_from_apt()
      if rinfo:
        release = rinfo.get('version')

        if release:
            codename = lookup_codename(release, 'n/a')
        else:
            release = rinfo.get('suite', 'unstable')
            if release == 'testing':
                # Would be nice if I didn't have to hardcode this.
                codename = TESTING_CODENAME
            else:
                codename = 'ceres'
        distinfo.update({ 'RELEASE' : release, 'CODENAME' : codename })
  • Called by guess_devuan_release(), the function parse_apt_policy() of lsb_release.py executes in a sub-shell the command 'env LC_ALL=C apt-cache policy'

Then, I suspected /usr/bin/apt-cache. Indeed, it fails with no root permission:

demo@upgraded_devuan2:~$ 
Package files:
 100 /var/lib/dpkg/status
     release a=now
Pinned packages:
demo@upgraded_devuan2:~$

What's broken with apt?
I reinstalled the package apt. But this makes no change.
Debugging this re-installation with apt-get -o Debug::RunScript -o Debug::pkgAcquire::Worker -o Debug::pkgAcquire::Auth -y --reinstall install apt, I saw nothing interesting.

The perms and ownerships of /etc/apt/sources.list and /etc/apt/sources.list.d/* looked normal.

So as a last resort, I decided to check the execution of /usr/bin/apt-cache with strace :

demo@upgraded_devuan2:~$ strace -x -e trace=open,close,read,write -o apt-cache_strace_demo.log env LC_ALL=C apt-cache policy
root@upgraded_devuan2:~# strace -x -e trace=open,close,read,write -o apt-cache_strace_root.log env LC_ALL=C apt-cache policy

root@upgraded_devuan2:~# grep "Permission denied" apt-cache_strace_root.log
demo@upgraded_devuan2:~$ grep "Permission denied" apt-cache_strace_demo.log 
open("/var/lib/apt/lists/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
...

Never was so close to the truth:

demo@upgraded_devuan2:~$ stat /var/lib/apt/lists
  Fichier : /var/lib/apt/lists
   Taille : 4096        Blocs : 8          Blocs d'E/S : 4096   répertoire
Périphérique : fe00h/65024d     Inœud : 1047578     Liens : 3
Accès : (0770/drwxrwx---)  UID : (    0/    root)   GID : (    0/    root)

demo@fresh_installed_devuan2:~$ stat /var/lib/apt/lists
  Fichier : /var/lib/apt/lists
   Taille : 4096      	Blocs : 8          Blocs d'E/S : 4096   répertoire
Périphérique : 801h/2049d	Inœud : 260613      Liens : 3
Accès : (0755/drwxr-xr-x)  UID : (    0/    root)   GID : (    0/    root)

Obviously, the only problem that prevented apt-cache to run correctly as a no-root user, with side effects on lsb_release is a directory permission.
Then I fixed it:

chmod 755 /var/lib/apt/lists

Hope this can help.

#6 Re: Hardware & System Configuration » I can not run software-properties-kde » 2018-08-23 23:58:07

Hi cynwulf!

I have just detected the script /usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py is not really compatible with Devuan2, and prevents the user to access the repository settings from synaptic with the same error you have pointed:

user@devuan2:~$ synaptic-pkexec 
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 109, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Devuan/ascii

With no bug fix at the moment, the workaround is to remove the package python3-software-properties.

Hope this can help.

Board footer

Forum Software