Welcome to the Linux Foundation Forum!

Exercise 34.5: Recovering Using the Install Image on Debian/Ubuntu

Hi,

I'm sorry if I ask even one more question again. But Exercise 34.5 is only explaining the recovery of the packet on RedHat-based systems. Unfortunately I was not able to transfer the commands to Ubuntu and recover the Package from the according image. I can mount the Ubuntu install media in the rescue environment, but cannot find the requested zsh package:
alu@ubuntu-dt-vm:~$ find /media/ -name 'zsh'
alu@ubuntu-dt-vm:~$

What I found is:
alu@ubuntu-dt-vm:/media/alu/Ubuntu 24.04.1 LTS amd64/dists/noble/main/binary-amd64$ ls -lh
total 52K
-r--r--r-- 1 alu alu 52K Aug 27 18:22 Packages.gz

Which I guess is only a reference file or something?

By the way, the image is the full 6.2 GB Ubuntu Desktop 24.04 image.

Thanks,
Urs

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Hi Urs,

    In that case you can use 'dpkg -i <package_name.deb>' with the full path, for the associated deb file you are going to install by hand. In the case of Debian, the zsh tool is available as well. The thing is that in the DVD iso for Ubuntu I can't find the zsh tool. But you can mount the iso file and search for ".deb" files, as follows:

    luis@selinuxbox:~$ find /media/cdrom/ -name "*.deb"
    /media/cdrom/pool/main/a/amd64-microcode/amd64-microcode_3.20231019.1ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/b43-fwcutter/b43-fwcutter_1%3a019-11build1_amd64.deb
    /media/cdrom/pool/main/b/bcache-tools/bcache-tools_1.0.8-5build1_amd64.deb
    /media/cdrom/pool/main/b/binutils/binutils_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/binutils-common_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/binutils-x86-64-linux-gnu_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/libbinutils_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/libctf0_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/libctf-nobfd0_2.42-4ubuntu2_amd64.deb
    /media/cdrom/pool/main/b/binutils/libgprofng0_2.42-4ubuntu2_amd64.deb

    [...]

    That's on Debian 12. The thing is to find a simple package that doesn't require dependencies to install, but you can try.

    Another way to make this work for Debian/Ubuntu, is to copy the zsh .deb file to the USB stick (and all its dependencies as well), so when you rescue the system, you can have the right packages to install.

    Regards,
    Luis.

  • Hi Luis,

    Thank you very much. With the Debian iso I managed it to install the according zsh packages.

    In calse someone else will have to do that too, or you consider to update this course, these are the steps which I made:

    1. Downloading the latest full Debian iso.
    2. Booting into the Ubuntu install media.
    3. Open the terminal and do as follows.
    1. ubuntu@ubuntu:~$ lsblk
    2. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
    3. loop0 7:0 0 1.6G 1 loop /rofs
    4. loop1 7:1 0 471M 1 loop
    5. loop2 7:2 0 874.4M 1 loop
    6. loop3 7:3 0 4K 1 loop /snap/bare/5
    7. loop4 7:4 0 269.8M 1 loop /snap/firefox/4793
    8. loop5 7:5 0 10.7M 1 loop /snap/firmware-updater/127
    9. loop6 7:6 0 505.1M 1 loop /snap/gnome-42-2204/176
    10. loop7 7:7 0 38.8M 1 loop /snap/snapd/21759
    11. loop8 7:8 0 74.3M 1 loop /snap/core22/1564
    12. loop9 7:9 0 500K 1 loop /snap/snapd-desktop-integration/178
    13. loop10 7:10 0 149.6M 1 loop /snap/thunderbird/507
    14. loop11 7:11 0 116.8M 1 loop /snap/ubuntu-desktop-bootstrap/237
    15. loop12 7:12 0 10.5M 1 loop /snap/snap-store/1173
    16. loop13 7:13 0 91.7M 1 loop /snap/gtk-common-themes/1535
    17. sr0 11:0 1 5.8G 0 rom /cdrom
    18. sr1 11:1 1 3.7G 0 rom
    19. vda 253:0 0 128G 0 disk
    20. ├─vda1 253:1 0 1M 0 part
    21. ├─vda2 253:2 0 2G 0 part
    22. └─vda3 253:3 0 126G 0 part
    23. └─ubuntu--vg-ubuntu--lv 252:0 0 126G 0 lvm
    24. ubuntu@ubuntu:~$ cd /mnt
    25. ubuntu@ubuntu:/mnt$ sudo mkdir sr{0,1} sysimage
    26. ubuntu@ubuntu:/mnt$ ls
    27. sr0 sr1 sysimage
    28. ubuntu@ubuntu:/mnt$ sudo su
    29. root@ubuntu:/mnt# mount /dev/sr0 /mnt/sr0
    30. mount: /mnt/sr0: WARNING: source write-protected, mounted read-only.
    31. root@ubuntu:/mnt# mount /dev/sr1 /mnt/sr1
    32. mount: /mnt/sr1: WARNING: source write-protected, mounted read-only.
    33. root@ubuntu:/mnt# vgscan
    34. Found volume group "ubuntu-vg" using metadata type lvm2
    35. root@ubuntu:/mnt# vgchange -ay
    36. 1 logical volume(s) in volume group "ubuntu-vg" now active
    37. root@ubuntu:/mnt# lvs
    38. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    39. ubuntu-lv ubuntu-vg -wi-a----- <126.00g
    40. root@ubuntu:/mnt# lvdisplay
    41. --- Logical volume ---
    42. LV Path /dev/ubuntu-vg/ubuntu-lv
    43. LV Name ubuntu-lv
    44. VG Name ubuntu-vg
    45. LV UUID w50odd-lx32-TSbE-KtHx-tXiO-5nzY-DBx7iB
    46. LV Write Access read/write
    47. LV Creation host, time ubuntu, 2024-10-29 07:36:06 +0000
    48. LV Status available
    49. # open 0
    50. LV Size <126.00 GiB
    51. Current LE 32255
    52. Segments 1
    53. Allocation inherit
    54. Read ahead sectors auto
    55. - currently set to 256
    56. Block device 252:0
    57.  
    58. root@ubuntu:/mnt# mount /dev/ubuntu-vg/ubuntu-lv /mnt/sysimage/
    59. root@ubuntu:/mnt# ls
    60. sr0 sr1 sysimage
    61. root@ubuntu:/mnt# cd sr1
    62. root@ubuntu:/mnt/sr1# ls
    63. boot dists firmware isolinux pool README.mirrors.txt
    64. css doc install md5sum.txt README.html README.source
    65. debian EFI install.amd pics README.mirrors.html README.txt
    66. root@ubuntu:/mnt/sr1# find . -name '*zsh*'
    67. ./pool/main/z/zsh
    68. ./pool/main/z/zsh/zsh_5.9-4+b5_amd64.deb
    69. ./pool/main/z/zsh/zsh-common_5.9-4_all.deb
    70. root@ubuntu:/mnt/sr1# dpkg --root=/mnt/sysimage/ --install /mnt/sr1/pool/main/z/zsh*.deb
    71. dpkg: error: cannot access archive '/mnt/sr1/pool/main/z/zsh*.deb': No such file or directory
    72. root@ubuntu:/mnt/sr1# dpkg --root=/mnt/sysimage/ --install /mnt/sr1/pool/main/z/zsh/zsh*.deb
    73. Selecting previously unselected package zsh.
    74. (Reading database ... 211566 files and directories currently installed.)
    75. Preparing to unpack .../z/zsh/zsh_5.9-4+b5_amd64.deb ...
    76. Unpacking zsh (5.9-4+b5) ...
    77. Selecting previously unselected package zsh-common.
    78. Preparing to unpack .../z/zsh/zsh-common_5.9-4_all.deb ...
    79. Unpacking zsh-common (5.9-4) ...
    80. Setting up zsh-common (5.9-4) ...
    81. Setting up zsh (5.9-4+b5) ...
    82. Processing triggers for debianutils (5.17build1) ...
    83. Processing triggers for man-db (2.12.0-4build2) ...
    84. root@ubuntu:/mnt/sr1#
    1. Remove the Ubuntu install media and reboot the system.

    Thanks again, Luis!

    Best wishes,
    Urs

  • Hi Urs, it's a pleasure! I'm glad you were able to do it on Ubuntu/Debian.

    Regards,
    Luis.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training