Ubuntu 10.04 TLS in openVz container can't install anything

Asked by Andras Mocsary

I think, in an openVz container kernel, kernel modules, boot loader, direct device access and similar stuff is both pointless and not needed, because these are all handled by the hardware node.

Problem is, dpkg wants to install linux-image, initramfs-tools, initscripts and also would like to write /lib/modules, which is not writeable for OSes in an openVz container.

How can I tell it to:
- completely ignore these packages
- never try to write to /lib/modules or if it tryes it should not fail because of it

Here are some outputs:

root@trac:~# uname -a
Linux trac 2.6.32-openvz-053.5-h1 #2 SMP Mon Jun 11 09:52:55 CEST 2012 x86_64 GNU/Linux
root@trac:~#

root@trac:~# ls -laph /lib/modules/
total 44K
drwxr-xr-x 9 root root 4.0K 2012-06-11 09:55 ./
drwxr-xr-x 16 root root 12K 2012-07-04 18:51 ../
drwxr-xr-x 3 root root 4.0K 2012-03-06 18:46 2.6.32-openvz-049.6/
drwxr-xr-x 3 root root 4.0K 2012-03-09 14:23 2.6.32-openvz-049.6-i1/
drwxr-xr-x 3 root root 4.0K 2012-04-27 11:33 2.6.32-openvz-049.6-i2/
drwxr-xr-x 4 root root 4.0K 2012-05-29 11:10 2.6.32-openvz-049.6-i3/
drwxr-xr-x 3 root root 4.0K 2012-05-30 10:55 2.6.32-openvz-049.6-y1/
drwxr-xr-x 4 root root 4.0K 2012-05-30 11:42 2.6.32-openvz-053.5/
drwxr-xr-x 3 root root 4.0K 2012-06-11 09:55 2.6.32-openvz-053.5-h1/
root@trac:~#

root@trac:~# dpkg -l | grep -i linux-image
rc linux-image-2.6.32-28-generic 2.6.32-28.55 Linux kernel image for version
2.6.32 on x86
ii linux-image-2.6.32-29-virtual 2.6.32-29.58 Linux kernel image for version
2.6.32 on x86
iH linux-image-2.6.32-37-virtual 2.6.32-37.81 Linux kernel image for version
2.6.32 on x86
iH linux-image-2.6.32-39-virtual 2.6.32-39.86 Linux kernel image for version
2.6.32 on x86
root@trac:~#

root@trac:~# lshw
trac
    description: Computer
    width: 64 bits
    capabilities: vsyscall64 vsyscall32
  *-core
       description: Motherboard
       physical id: 0
     *-memory
          description: System memory
          physical id: 0
          size: 2047MiB
     *-cpu
          product: Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz
          vendor: Intel Corp.
          physical id: 1
          bus info: cpu@0
          width: 64 bits
          capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts
 acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good xtopology nons
top_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shado
w vnmi flexpriority ept vpid
     *-scsi:0
          physical id: 2
          bus info: pci@0000:01:00.0
          logical name: scsi0
        *-disk:0 UNCLAIMED
             description: SCSI Disk
             product: ServeRAID M5014
             vendor: IBM
             physical id: 2.0.0
             bus info: scsi@0:2.0.0
             version: 2.12
             serial: 00a88136d8dc776b1750a01804b00506
             configuration: ansiversion=5
        *-disk:1 UNCLAIMED
             description: SCSI Disk
             product: ServeRAID M5014
             vendor: IBM
             physical id: 2.1.0
             bus info: scsi@0:2.1.0
             version: 2.12
             serial: 0013f9c2e4ae786b1750a01804b00506
             configuration: ansiversion=5
        *-disk:2 UNCLAIMED
             description: SCSI Disk
             product: ServeRAID M5014
             vendor: IBM
             physical id: 2.2.0
             bus info: scsi@0:2.2.0
             version: 2.12
             serial: 0091b18530482c6f1750a01804b00506
             configuration: ansiversion=5
     *-scsi:1
          physical id: 3
          bus info: pci@0000:04:00.1
          logical name: scsi9
          capabilities: emulated
        *-disk UNCLAIMED
             description: ATA Disk
             product: ST340014A
             vendor: Seagate
             physical id: 0.0.0
             bus info: scsi@9:0.0.0
             version: 8.10
             serial: 5JXG7A47
             configuration: ansiversion=5
root@trac:~#

root@trac:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.4 LTS
Release: 10.04
Codename: lucid
root@trac:~#

root@trac:~# aptitude install kubuntu-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
The following partially installed packages will be configured:
  initramfs-tools initscripts
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/25.1MB of archives. After unpacking 0B will be used.
Writing extended state information... Done
Selecting previously deselected package linux-image-2.6.32-37-virtual.
(Reading database ... 163003 files and directories currently installed.)
Preparing to replace linux-image-2.6.32-37-virtual 2.6.32-37.81 (using .../linux-image-2.6.32-37-virtual_2.6.32-37.81_am
d64.deb) ...
Done.
Unpacking replacement linux-image-2.6.32-37-virtual ...
dpkg: error processing /var/cache/apt/archives/linux-image-2.6.32-37-virtual_2.6.32-37.81_amd64.deb (--unpack):
 unable to securely remove '/lib/modules/2.6.32-37-server.dpkg-new': Read-only file system
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Could not find postrm hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
Selecting previously deselected package linux-image-2.6.32-39-virtual.
Preparing to replace linux-image-2.6.32-39-virtual 2.6.32-39.86 (using .../linux-image-2.6.32-39-virtual_2.6.32-39.86_am
d64.deb) ...
Done.
Unpacking replacement linux-image-2.6.32-39-virtual ...
dpkg: error processing /var/cache/apt/archives/linux-image-2.6.32-39-virtual_2.6.32-39.86_amd64.deb (--unpack):
 unable to securely remove '/lib/modules/2.6.32-39-server.dpkg-new': Read-only file system
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Could not find postrm hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-2.6.32-37-virtual_2.6.32-37.81_amd64.deb
 /var/cache/apt/archives/linux-image-2.6.32-39-virtual_2.6.32-39.86_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up initramfs-tools (0.92bubuntu78) ...
update-initramfs: deferring update (trigger activated)

Setting up initscripts (2.87dsf-4ubuntu17.5) ...
update-rc.d: /etc/init.d/ondemand: file does not exist
dpkg: error processing initscripts (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-39-server
Cannot find /lib/modules/2.6.32-39-server
update-initramfs: failed for /boot/initrd.img-2.6.32-39-server
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initscripts
 initramfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

root@trac:~#

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
cybernet
Solved:
Last query:
Last reply:
Revision history for this message
Andras Mocsary (amocsy) said :
#1

root@trac:~# do-release-upgrade
Checking for a new ubuntu release
Done Upgrade tool signature
Done Upgrade tool
Done downloading
authenticate 'maverick.tar.gz' against 'maverick.tar.gz.gpg'
extracting 'maverick.tar.gz'
tar: Removing leading `/' from member names
pcilib: Cannot open /proc/bus/pci
lspci: Cannot find any working access method.

Reading cache

Checking package manager

Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.

Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done

Updating repository information
WARNING: Failed to read mirror file
100% [Working]
Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done

Calculating the changes

Calculating the changes

A fatal error occurred

Please report this as a bug and include the files
/var/log/dist-upgrade/main.log and /var/log/dist-upgrade/apt.log in
your report. The upgrade has aborted.
Your original sources.list was saved in
/etc/apt/sources.list.distUpgrade.

Traceback (most recent call last):

File "/tmp/tmpsx4cOr/maverick", line 7, in <module>
sys.exit(main())

File "/tmp/tmpsx4cOr/DistUpgradeMain.py", line 158, in main
if app.run():

File "/tmp/tmpsx4cOr/DistUpgradeController.py", line 1616, in run
return self.fullUpgrade()

File "/tmp/tmpsx4cOr/DistUpgradeController.py", line 1578, in
fullUpgrade
if not self.askDistUpgrade():

File "/tmp/tmpsx4cOr/DistUpgradeController.py", line 878, in
askDistUpgrade
if not self._checkFreeSpace():

File "/tmp/tmpsx4cOr/DistUpgradeController.py", line 846, in
_checkFreeSpace
self.cache.checkFreeSpace()

File "/tmp/tmpsx4cOr/DistUpgradeCache.py", line 1103, in
checkFreeSpace
for (dir, size) in [(archivedir, self.requiredDownload),

File "/tmp/tmpsx4cOr/DistUpgradeCache.py", line 198, in
requiredDownload
pm.get_archives(fetcher, self._list, self._records)

SystemError: E:I wasn't able to locate file for the
linux-image-2.6.32-37-virtual package. This might mean you need to
manually fix this package.

root@trac:~#

Revision history for this message
Best cybernet (cybernet2u) said :
#2

first of all, you can't install a "desktop" inside a openVZ container
second, if you want to upgrade, you have to reinstall your container with the desired template
http://wiki.openvz.org/Download/template/precreated

third - use CentOS 6 x64 for the HOST node

and read the manual, if you really wanna learn something about openVZ
http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

Revision history for this message
Andras Mocsary (amocsy) said :
#3

Thank you for the links, I'll parse the info.
I am not able to change the openVZ host and do not actually know what it is.
I however may be able to re-install the container with some new template, I'll consider it.
However I did managed to upgrade to the latest ubuntu, and also installed kubuntu-desktop, as well as xubuntu-desktop.

Revision history for this message
Andras Mocsary (amocsy) said :
#4

Thanks cybernet, that solved my question.