How do I resolve package dependencies for a different target system?


(TL;DR: how do I determine the minimum set of packages to install, given an initial state and desired package list?)

I’m creating an Ubuntu installer ISO for systems without access to distribution mirrors. These are embedded devices which need only the base packages and a handful of locally-built packages plus all their dependencies. For instance, we’re using Qt/Xcb, so the various libqt5* packages need to be pulled in.

At the moment, I’m using a brute-force approach to determine what to put in the pool/extras directory of the installer. First I seed with the packages that are mentioned in d-i pkgsel/include answer to debconf, then hunt down the recursive dependencies with the following bash command:

# 1. Extract the dependencies from packages/*, removing version
#    conditions and changing separator to newline.
# 2. Find the recursive dependencies of all these packages using
#    package database, extracting Depends and PreDepends.
# 3. For each package we require:
#    a. if we find it in our cache, just copy it into the ISO (using
#       hard link for speed and space)
#    b. else, if we find it already in the ISO, do nothing
#    c. else, pass it through to step 4.
# 4. Search for matching packages in repositories that are not virtual
#    or foreign-architecture.
# 5. Download matching package files to the ISO.
(for i in "$TOP/packages"/*.deb; do dpkg-deb -f $i depends; done) | sed 's/([^()]*)//g;s/[|,]/n/g'                                     
  | xargs -r apt-cache --recurse --important depends | sed -re 's/^  (Pre)?Depends://;/[<|:]/d;s/^  *//;' | sort -u                     
  | ( while read p;                                                                                                                     
    do test $(find "$TOP/extras" -name "${p}_*.deb" -exec mv '{}' "$REMASTER_HOME"/remaster-iso/pool/extras ; -printf "true" -quit)    
      || test $(find "$REMASTER_HOME"/remaster-iso/pool/{main,extras} -name "${p}_*.deb" -printf "true" -quit)                          
      || echo $p;                                                                                                                       
    done; )                                                                                                                             
  | uniq | sed -r 's/[^ ]+/!~rforeign!~v^&$/' | xargs -r aptitude -q2 -F '%p' search                                                    
  | (cd "$REMASTER_HOME"/remaster-iso/pool/extras; xargs -r apt-get download)

Here, $TOP/packages is the seed-package directory, $TOP/extras is a cache of previously-downloaded packages, and $REMASTER_HOME"/remaster-iso is the root of the unpacked installer ISO.

Whilst the above works, it tends to fetch much more than we actually require, because apt-cache depends reports all the alternative dependencies of each package. For example, grub-pc depends on debconf; cdebconf provides debconf, so both debconf and cdebconf are included, along with their dependencies. Also, xserver-xorg depends on xserver-xorg-video-all | xorg-driver-video, so my script pulls all the video drivers – but I’ve already declared a dependency on xserver-xorg-video-fbdev, so I would like that to satisfy the requirements on its own.

What I would like is the equivalent of running aptitude --download-only install ${MY_PACKAGES} on the target system. But of course, running that on the build host will miss most of the packages because they are already installed there.

I’m currently looking at the python-apt library, but I can’t find any examples of initializing it for a target system rather than the host where it’s running. Has anybody done something similar, from which I can copy?

Alternatively, are there other approaches that might work? I’m considering creating a pristine, minimal chroot and running the aptitude command in that, but I’m concerned that will be a maintenance burden and hard for others to set up on their own machines.

I’m hoping the solution can be used (with a new initial state) to find the necessary dependencies when any packages are to be updated, as I’ll need to write a consistent set to removable media for the target system (still with no access to distribution mirrors).

Database Normalization vs dependencies


I am developing 3-4 interdependent programs. Call them foo bar baz and auth. I want them to be independent of each other. Imagine if I were to license out each program to other companies. Some companies may want foo and bar, others may just want baz, etc. It also seems like good practice to keep auth independent as well.

Context:
auth is taking care of authentication for all of the systems. The main users table in auth has user_id, email, password, first, last

foo has a users table as well which has specific fields for the application:
user_id, role_id, etc.

Each system has its own database. In the past I have created a foreign key from each application to the auth db. I removed update permissions from the other dbs but granted select access to certain relevant fields. This seems like a bad solution because it creates a tight dependency, but it allowed me to normalize the db so that I didn’t have to store the users name and email in the foo, bar, or baz databases.

Would it be better to store the information in all of the databases? Or would it be better to store the Auth Id in foo bar and baz and use an api to get the user info using the authId?

Similarly, I might have customers in all 3 systems. Sure it seems bad to create a dependency into an auth db, but what about the customer dbs across all 3 of them?

Or is the best solution to have one central db. One users table.

enter image description here

Other Suggestions?

Unmet dependencies when installing mtrack


I’m trying to install mtrack on Ubuntu 14.04 on my macbook pro:

sudo apt-get install xserver-xorg-input-mtrack

But I get unmet dependencies:

The following packages have unmet dependencies.
 xserver-xorg-input-mtrack : Depends: xorg-input-abi-20
                         Depends: xserver-xorg-core (>= 2:1.14.99.902)
E: Unable to correct problems, you have held broken packages.

I tried

sudo apt-get install xserver-xorg-core

from here: http://askubuntu.com/questions/610505/broken-packages-error-while-trying-to-install-xserver-xorg-input-mtrack to no avail.

Edit for the fine gentlemen in the comments:

xserver-xorg-core:
  Installed: (none)
  Candidate: 2:1.15.1-0ubuntu2.7
  Version table:
     2:1.15.1-0ubuntu2.7 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     2:1.15.1-0ubuntu2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

unmet dependencies for gir1.2-accountsservice-1.0 on Ubuntu 14.04.2


I’m trying to install a software package which depends on gir1.2-accountsservice-1.0. However, when I attempt to install gir1.2-accountsservice-1.0 I get the following message:

sudo apt-get install gir1.2-accountsservice-1.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gir1.2-accountsservice-1.0 : Depends: libaccountsservice0 (>= 0.6.35-0ubuntu7.2) but 0.6.35-0ubuntu7.1+SCSp3 is to be installed
E: Unable to correct problems, you have held broken packages.

OS: Ubuntu 14.04.2 LTS with Unity desktop

I tried getting it from here: https://launchpad.net/ubuntu/+source….35-0ubuntu7.2
but when I try to build this package I get a rather excessive list of dependency issues, so I would much rather install this through an apt-get install command.

What is the systemd equvalent to sysvinit 'X-Start-Before'?


Quoted from https://wiki.debian.org/LSBInitScripts.

X-Start-Before: boot_facility_1 [boot_facility_2...]

X-Stop-After: boot_facility_1 [boot_facility_2...]

provide reverse dependencies, that appear as if the listed facilities had should-start and should-stop on the package with these headers.

What is the systemd equvalent to sysvinit X-Start-Before?

Similar to systemd’s Before=, but stronger, as a dependency.

About Dependencies


In the absence of internet connection for the present, I am trying to use apt-offline. When I execute the order in terminal I get “ERROR: FATAL: Something is wrong with the apt system.” I have been told that this problem is probably a dependencies problem.

So I run “apt-get -f install” and there appeared some dependencies. I tried to install some of them to be, then, able to use apt-offline.

But, the problem is, it seems even more dependencies appeared. To the question then:

Question: Is there a way to “kill” all those dependencies? To somehow maybe get reed of them and be able to use the apt-offline?

Thank you.

NOTE: These are the orders:

1)

kwstas@debian:~$ su -c  'apt-offline set /tmp/apt-offline.sig'
Password: 

Generating database of files that are needed for an update.

Generating database of files that are needed for an upgrade.
E: Unmet dependencies. Try using -f.
ERROR: FATAL: Something is wrong with the apt system.

2)Then I run and I get:

kwstas@debian:~$ su -c 'apt-get -f install'
Password: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  brasero brasero-cdrkit brasero-common dvdauthor freepats genisoimage
  growisofs libexempi3 libfftw3-double3 libfluidsynth1 libgme0 libgmime-2.6-0
  libgtkglext1 libiptcdata0 libmediaart-1.0-0 libmimic0 libmjpegutils-2.1-0
  libmms0 libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libmusicbrainz5-1
  libnautilus-extension1a libofa0 libopenal-data libopenal1
  libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4
  libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4
  libopencv-imgproc2.4 libopencv-legacy2.4 libopencv-ml2.4
  libopencv-objdetect2.4 libopencv-video2.4 libquvi-scripts libquvi7 libsbc1
  libsoundtouch0 libspandsp2 libsrtp0 libtbb2 libtotem-plparser18
  libtracker-sparql-1.0-0 libunistring0 libvo-aacenc0 libvo-amrwbenc0
  libwildmidi-config libwildmidi1 libzbar0 sound-juicer wodim
Suggested packages:
  vcdimager libdvdcss2 tracker readom cdrkit-doc libfftw3-bin libfftw3-dev
  srtp-utils gstreamer1.0-lame gstreamer1.0-plugins-really-bad
Recommended packages:
  yelp
The following packages will be REMOVED:
  gstreamer1.0-plugins-bad
The following NEW packages will be installed:
  brasero-cdrkit dvdauthor freepats genisoimage growisofs libexempi3
  libfftw3-double3 libfluidsynth1 libgme0 libgmime-2.6-0 libgtkglext1
  libiptcdata0 libmediaart-1.0-0 libmimic0 libmjpegutils-2.1-0 libmms0
  libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libmusicbrainz5-1
  libnautilus-extension1a libofa0 libopenal-data libopenal1
  libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4
  libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4
  libopencv-imgproc2.4 libopencv-legacy2.4 libopencv-ml2.4
  libopencv-objdetect2.4 libopencv-video2.4 libquvi-scripts libquvi7 libsbc1
  libsoundtouch0 libspandsp2 libsrtp0 libtbb2 libtotem-plparser18
  libtracker-sparql-1.0-0 libunistring0 libvo-aacenc0 libvo-amrwbenc0
  libwildmidi-config libwildmidi1 libzbar0 wodim
The following packages will be upgraded:
  brasero brasero-common sound-juicer
3 upgraded, 51 newly installed, 1 to remove and 2 not upgraded.
4 not fully installed or removed.
Need to get 43.2 MB of archives.
After this operation, 55.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

3)The rest is when I reply yes:

Err http://ftp.cc.uoc.gr/mirrors/linux/debian/ jessie/main brasero i386 3.11.4-1.1
  Could not resolve 'ftp.cc.uoc.gr'
Err http://ftp.cc.uoc.gr/mirrors/linux/debian/ jessie/main brasero-common all 3.11.4-1.1
  Could not resolve 'ftp.cc.uoc.gr'
Err http://ftp.cc.uoc.gr/mirrors/linux/debian/ jessie/main libgmime-2.6-0 i386 2.6.20-1+b1
  Could not resolve 'ftp.cc.uoc.gr'
Err http://ftp.cc.uoc.gr/mirrors/linux/debian/ jessie/main libquvi-scripts all 0.4.21-2
  Could not resolve 'ftp.cc.uoc.gr'

.
.
. and it goes until:

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Circular dependency in Ubuntu Release upgrade


The title is the best way I could describe this error.

Basically the packages kbd, console-setup, console-setup-linux, and keyboard-configuration all depend on each other. So I cannot remove, configure, or purge them. When attempting to run dpkg --configure <package name> it returns the error:

dpkg: dependency problems prevent configuration of <package name>:

It goes on to list the specific dependencies. Upon trying to configure those, it eventually ends up back at the original package.

Am I missing something?


Edit: It appears I can configure keyboard-configuration, but it gives me this error:

user@ip:~$ sudo dpkg --configure keyboard-configuration
Setting up keyboard-configuration (1.108ubuntu5) ...
/var/lib/dpkg/info/keyboard-configuration.postinst: 1: /var/lib/dpkg/info/keyboard-configuration.postinst: udpkg: not found
/usr/bin/ckbcomp: Can not find file "symbols/en" in any known directory
dpkg: error processing package keyboard-configuration (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 keyboard-configuration

Creating objects containing collections of themselves


I’m creating a simple data structure using PL/SQL to help me work with some rows in tables which have dependencies upon each other.

In short, I’d like to be able to create a graph using any combination of Objects/Types/Tables. Each ITEM has a 4 composite keys, and references any amount of other ITEM’s.

The problem is that attempting to create a nested table to contain the dependencies results in a circular reference of sorts, which PL/SQL cannot handle, giving me errors such as the following:

Error: ORA-02303: cannot drop or replace a type with type or table dependents

Error: ORA-06545: PL/SQL: compilation error – compilation aborted
ORA-06550: line 0, column 0:
PLS-00565: DEPENDENCIES must be completed as a potential REF target (object type)

What I’d really like to have is something as simple as the following:

CREATE OR REPLACE
TYPE ITEM AS OBJECT (
  first  VARCHAR2(10),
  second VARCHAR2(10),
  third  VARCHAR2(10),
  fourth VARCHAR2(10),
  deps   DEPENDENCIES
  -- Functions & Procedures omitted
)

CREATE OR REPLACE
TYPE DEPENDENCIES AS TABLE OF ITEM

Is there a way I can satisfy Oracle, or work around this problem?

Decompose table into third normal form


Tables X and Y are given as below :

X (A, B, D, E, F, G, H, J) with A and B as primary key
Y (K, L, M, N, O, P, Q, R) with K and L as primary key

Now we need to decompose these tables into tables in the third normal form using the functional dependencies specified below:

  1. A -> G, H
  2. B -> D, E, F
  3. E -> F
  4. H -> G
  5. L -> N, O, P, Q
  6. N -> Q

I need to specify primary keys and foreign keys also. Please help to solve this problem.

I am newbie to normalization. So please help to solve this problem.If I normalize to 2NF I loose some relations which doesn’t suit to 3NF. So I am confused. Any help will be appreciated. Because to convert to 3NF I need to go through 2NF too.

I had changed it to 3NF. Please help in finding if am right in doing it

R1 (E, F)
R2 (H, G)
R3 (A, B, L)
R4 (A, H)
R5 (B, D, E)

R6 (N, Q)
R7 (K, L, M, R)
R8 (L, N, O, P)

Gpgpu-sim dependencies in centOS


I try to install gpgpu-sim in my CentOS 6, there are some dependencies need to be installed before I can compile gpgpu-sim successfully. the dependencies are as follows:

  1. GPGPU-Sim dependencies:

    • gcc
    • g++
    • make
    • makedepend
    • xutils
    • bison
    • flex
    • zlib
    • CUDA Toolkit
  2. GPGPU-Sim documentation dependencies:

    • doxygen
    • graphvi
  3. AerialVision dependencies:

    • python-pmw
    • python-ply
    • python-numpy
    • libpng12-dev
    • python-matplotlib

I know how to install this dependencies in Ubuntu, the command line are as follows:

sudo apt-get install build-essential xutils-dev bison zlib1g-dev flex  libglu1-mesa-dev
sudo apt-get install doxygen graphviz
sudo apt-get install python-pmw python-ply python-numpy libpng12-dev python-matplotlib
sudo apt-get install libxi-dev libxmu-dev freeglut3-dev

I have installed and run gpgpu-sim in ubuntu 14.04, now I need to installed it on centOS.

I have tried some solution like this:
yum list bison flex
I can get the prompt that bison.x86_64 and flex.x86_64 has installed.

yum search libxi-dev libxmu-dev

I can found matches and installed them.

When I tried to search other dependencies:

yum search build-essential
yum search zlib1g-dev
yum search xutils-dev
yum search libglu1-mesa-dev
yum search python-pmw
yum search python-ply
yum search python-numpy
yum search python-matplotlib
yum search libpng12-dev
yum search freeglut3-dev

the search results are:

warning: no matches found for :<depencency name>

there is different software manager in centOS with ubuntu, who can tell me how to installed these dependencies correctly?

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam