ubuntu-advantage-tools fails setup
We recently encountered an issue with our deployment pipeline when installing Ubuntu 18.04.
"ubuntu-minimal" now depends on ubuntu-
ModuleNotFoundE
I added OS packages 'python-opcua' and 'python3-opcua' and the error changed to:
No module named 'uaclient.
I'm wondering why the dependencies can't be resolved at install time through APT per usual. The setup consistently exits with a '1', which fails our build pipeline. Hopefully that's not the default behavior. More info in the comment below.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Related FAQ:
None Link to a FAQ
Revision history for this message
|
#1 |
On a newly installed system I can duplicate the error by reinstalling the package. Dpkg consistently returns exit code '1':
apt-get --reinstall install ubuntu-
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libiw30
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/622 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 95689 files and directories currently installed.)
Preparing to unpack .../ubuntu-
Unpacking ubuntu-
Setting up ubuntu-
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundE
dpkg: error processing package ubuntu-
installed ubuntu-
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Errors were encountered while processing:
ubuntu-
E: Sub-process /usr/bin/dpkg returned an error code (1)
Revision history for this message
|
#2 |
For diagnostic purposes, what is the output of the following commands:
uname -a
lsb_release -crid
apt-cache policy ubuntu-
python3 -c "from uaclient.
I was not able to duplicate the error on my test systems.
Can you describe the exact steps necessary to show that error (e.g. which installer do you use)?
Revision history for this message
|
#3 |
Here is the output from an Azure server built from Marketplace image:
tools@cis-ubu18:~$ uname -a
Linux cis-ubu18 5.4.0-1047-azure #49~18.04.1-Ubuntu SMP Thu Apr 22 21:28:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
tools@cis-ubu18:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
tools@cis-ubu18:~$ apt-cache policy ubuntu-
ubuntu-
Installed: 27.0.2~18.04.1
Candidate: 27.0.2~18.04.1
Version table:
*** 27.0.2~18.04.1 500
500 http://
100 /var/lib/
17 500
500 http://
tools@cis-ubu18:~$ python3 -c "from uaclient.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundE
I have similar results from a server built from the 18.04.4 ISO:
tools@cis-601:~$ uname -a
Linux cis-601 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
tools@cis-601:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
tools@cis-601:~$ apt-cache policy ubuntu-
ubuntu-
Installed: 17
Candidate: 27.0.2~18.04.1
Version table:
27.0.2~18.04.1 500
500 http://
*** 17 500
500 http://
500 http://
100 /var/lib/
tools@cis-601:~$ python3 -c "from uaclient.
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundE
Revision history for this message
|
#4 |
To clarify these are server not desktop images.
My final workaround was to:
a) pre-install 'python3-distutils' and 'python3-opcua'
b) force install ubuntu-
c) place ubuntu-
Then we were able to update all packages.
The ask here would be that if ubuntu-
Revision history for this message
|
#5 |
Correction - that's 'apt-mark hold' not 'apt-get mark'. I have never had to place a package on hold previously.
Revision history for this message
|
#6 |
The strange thing is that the uaclient python packages are contained in the ubuntu-
You write that you have found a workaround.
If you still want to tackle that problem further, then please provide the output of the following commands after a failed upgrade attempt:
ls -l /usr/lib/
ls -l /usr/lib/
Revision history for this message
|
#7 |
This is what I am seeing:
root@ubc60022:~#
root@ubc60022:~# dpkg --list | grep advantage
hi ubuntu-
root@ubc60022:~#
root@ubc60022:~# ls -l /usr/lib/
ls: cannot access '/usr/lib/
root@ubc60022:~#
root@ubc60022:~# ls -l /usr/lib/
ls: cannot access '/usr/lib/
Revision history for this message
|
#8 |
This is what I am seeing:
root@ubc60022:~#
root@ubc60022:~# dpkg --list | grep advantage
hi ubuntu-
root@ubc60022:~#
root@ubc60022:~# ls -l /usr/lib/
ls: cannot access '/usr/lib/
root@ubc60022:~#
root@ubc60022:~# ls -l /usr/lib/
ls: cannot access '/usr/lib/
Revision history for this message
|
#9 |
We are using a preseed file to configure our base server image. I've trimmed a few filesystems out and obfuscated a few items.
# Set locale and keyboard layout.
d-i keyboard-
d-i console-
d-i debian-
# Install the Ubuntu Server seed.
tasksel tasksel/force-tasks string server
# Skip making a regular user as we're going to join VMs cloned from this
# template to a domain. A root password must be set to continue this part of
# the installation, so it's set to something silly that will be removed later.
#d-i passwd/make-user boolean false
#d-i passwd/root-login boolean true
#d-i user-setup/
#
#account gets removed by post-install:
d-i passwd/
d-i passwd/username string installer
d-i passwd/
d-i passwd/
# Set the time zone to Pacific Time.
d-i time/zone string US/Los_Angeles
# Use sda whole disk with single boot part and remainder LVM
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-
d-i partman-
d-i partman-lvm/confirm boolean true
d-i partman-
# limit LVM to 48G - prevents 'growing' /home
d-i partman-
d-i partman-
d-i partman-
512 512 512 ext3 \
. \
100 1000 1000000000 ext3 \
. \
512 4096 50% linux-swap \
. \
8192 8192 8192 xfs \
. \
2048 2048 2048 xfs \
. \
4096 4096 4096 xfs \
. \
2048 2048 2048 xfs \
.
d-i partman-
d-i partman/
d-i partman/confirm boolean true
d-i partman/
# Only install basic language packs. Let tasksel ask about tasks.
#d-i pkgsel/
d-i pkgsel/
# No language support packages.
d-i pkgsel/
### Package selection
tasksel tasksel/first multiselect ubuntu-server
# Install some extra packages.
d-i pkgsel/include string openssh-server open-vm-tools net-tools ifupdown resolvconf iptables ufw auditd libpam-pwquality chrony aide aide-common apparmor man sssd samba-common-bin man wget ruby-shadow parted tcpd cloud-init curl
d-i pkgsel/exclude string telnet ftp
# Disable automatic updates. We don't want Ubuntu potentially mysteriously
# breaking things by default.
d-i pkgsel/
# Set the hardware clock to localtime. VMware is currently configured to use
# localtime, so this setting is necessary to ensure that the clock is set to
# the correct time.
d-i clock-setup/utc boolean false
# Verbose output and no boot splash screen.
d-i debian-
d-i debian-
# Install the debconf oem-config frontend (if in OEM mode).
#d-i oem-config-
# Install GRUB to the MBR.
d-i grub-installer/
# Add the network and tasks oem-config steps by default.
#oem-config oem-config/steps multiselect language, timezone, keyboard, user, network, tasks
# tell the installer to fire up the network console (for Packer) while the install runs
# we don't want to use the menu-driven network-console, so we set the "installer" to use ssh instead
d-i network-
d-i debconf/priority select critical
d-i auto-install/
d-i network-
d-i network-
d-i preseed/
anna-install network-console openssh-client-udeb && \
sed -i 's/network-
#d-i preseed/
d-i preseed/
# Halt the machine after the install. Packer will power off the machine after
# it's done provisioning it with Chef.
#d-i debian-
d-i finish-
Revision history for this message
|
#10 |
"ls: cannot access '/usr/lib/
That is a consequence of apt-mark hold to version 17.
/usr/lib/
You have to be aware that the package management system most probably has been left in an inconsistent state:
see the output of
sudo dpkg --audit
Revision history for this message
|
#11 |
The package is placed on HOLD as it exits with a non-zero status, which breaks our CI/CD pipeline.
Since I'm doing a fresh install, I'm not sure why version 27.0.2~18.04.1 is not available?
I can try staging the 27.0.2~18.04.1 DEB package somewhere that our pipeline can access it, and try to pre-install it before doing the apt-get update and upgrade. This seems like an issue with the server package repositories if I'm not getting the latest package by default.
Revision history for this message
|
#12 |
It appears that ubuntu-
It is now in the 18.04 repositories. Reverting my changes for the above and validating that fixes our pipeline issue.
Revision history for this message
|
#13 |
Within my pipeline I am getting version 27.0.2~18.04.1, but am its setup is still exiting with a '1' as shown below.
Preparing to unpack .../21-
dpkg: error processing package ubuntu-
"dpkg: error processing package ubuntu-minimal (--configure):", " dependency problems - leaving unconfigured"
Still trying to work around.
Revision history for this message
|
#14 |
Within my pipeline I am getting version 27.0.2~18.04.1, but am its setup is still exiting with a '1' as shown below.
Preparing to unpack .../21-
dpkg: error processing package ubuntu-
"dpkg: error processing package ubuntu-minimal (--configure):", " dependency problems - leaving unconfigured"
Still trying to work around.
Revision history for this message
|
#15 |
There is Bug #1927905 describing a similar problem for Ubuntu 16.04
and there is already a new version in development, see Bug #1929597
Revision history for this message
|
#16 |
I am facing a similar problem. When I do `sudo apt upgrade`, I get "ModuleNotFound
...
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ubuntu-
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundE
dpkg: error processing package ubuntu-
installed ubuntu-
Errors were encountered while processing:
ubuntu-
E: Sub-process /usr/bin/dpkg returned an error code (1)
What to do about this?
Revision history for this message
|
#17 |
@Kai Z.:
Please do not piggyback on somebody else's question, but create a question document of your own.
Your case is different.
The error message received by richard is "No module named 'uaclient.
and yours is "No module named 'uaclient'"
Revision history for this message
|
#18 |
Apologies. I am now getting "No module named 'uaclient.
I'll not continue my end of the thread here.
Revision history for this message
|
#19 |
You should install `opcua` and `opcua-client` with default python command:
python -m pip install --upgrade opcua
python -m pip install --upgrade opcua-client
Revision history for this message
|
#20 |
(on Ubuntu 18.04.5 LTS)
Having failed updates for a while
Believe this shall rather be (python 3 ?)
python3 -m pip install --upgrade opcua
python3 -m pip install --upgrade opcua-client
even after this, which passes well, updates fail
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up ubuntu-
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundE
dpkg: error processing package ubuntu-
installed ubuntu-
Errors were encountered while processing:
ubuntu-
E: Sub-process /usr/bin/dpkg returned an error code (1)
what is interesting is this:
$ sudo apt-get --reinstall install ubuntu-
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for ubuntu-
--
lj
Can you help with this problem?
Provide an answer of your own, or ask richard for more information if necessary.