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
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.0 -
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:
- Downloading the latest full Debian iso.
- Booting into the Ubuntu install media.
- Open the terminal and do as follows.
ubuntu@ubuntu:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 1.6G 1 loop /rofs loop1 7:1 0 471M 1 loop loop2 7:2 0 874.4M 1 loop loop3 7:3 0 4K 1 loop /snap/bare/5 loop4 7:4 0 269.8M 1 loop /snap/firefox/4793 loop5 7:5 0 10.7M 1 loop /snap/firmware-updater/127 loop6 7:6 0 505.1M 1 loop /snap/gnome-42-2204/176 loop7 7:7 0 38.8M 1 loop /snap/snapd/21759 loop8 7:8 0 74.3M 1 loop /snap/core22/1564 loop9 7:9 0 500K 1 loop /snap/snapd-desktop-integration/178 loop10 7:10 0 149.6M 1 loop /snap/thunderbird/507 loop11 7:11 0 116.8M 1 loop /snap/ubuntu-desktop-bootstrap/237 loop12 7:12 0 10.5M 1 loop /snap/snap-store/1173 loop13 7:13 0 91.7M 1 loop /snap/gtk-common-themes/1535 sr0 11:0 1 5.8G 0 rom /cdrom sr1 11:1 1 3.7G 0 rom vda 253:0 0 128G 0 disk ├─vda1 253:1 0 1M 0 part ├─vda2 253:2 0 2G 0 part └─vda3 253:3 0 126G 0 part └─ubuntu--vg-ubuntu--lv 252:0 0 126G 0 lvm ubuntu@ubuntu:~$ cd /mnt ubuntu@ubuntu:/mnt$ sudo mkdir sr{0,1} sysimage ubuntu@ubuntu:/mnt$ ls sr0 sr1 sysimage ubuntu@ubuntu:/mnt$ sudo su root@ubuntu:/mnt# mount /dev/sr0 /mnt/sr0 mount: /mnt/sr0: WARNING: source write-protected, mounted read-only. root@ubuntu:/mnt# mount /dev/sr1 /mnt/sr1 mount: /mnt/sr1: WARNING: source write-protected, mounted read-only. root@ubuntu:/mnt# vgscan Found volume group "ubuntu-vg" using metadata type lvm2 root@ubuntu:/mnt# vgchange -ay 1 logical volume(s) in volume group "ubuntu-vg" now active root@ubuntu:/mnt# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert ubuntu-lv ubuntu-vg -wi-a----- <126.00g root@ubuntu:/mnt# lvdisplay --- Logical volume --- LV Path /dev/ubuntu-vg/ubuntu-lv LV Name ubuntu-lv VG Name ubuntu-vg LV UUID w50odd-lx32-TSbE-KtHx-tXiO-5nzY-DBx7iB LV Write Access read/write LV Creation host, time ubuntu, 2024-10-29 07:36:06 +0000 LV Status available # open 0 LV Size <126.00 GiB Current LE 32255 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 252:0 root@ubuntu:/mnt# mount /dev/ubuntu-vg/ubuntu-lv /mnt/sysimage/ root@ubuntu:/mnt# ls sr0 sr1 sysimage root@ubuntu:/mnt# cd sr1 root@ubuntu:/mnt/sr1# ls boot dists firmware isolinux pool README.mirrors.txt css doc install md5sum.txt README.html README.source debian EFI install.amd pics README.mirrors.html README.txt root@ubuntu:/mnt/sr1# find . -name '*zsh*' ./pool/main/z/zsh ./pool/main/z/zsh/zsh_5.9-4+b5_amd64.deb ./pool/main/z/zsh/zsh-common_5.9-4_all.deb root@ubuntu:/mnt/sr1# dpkg --root=/mnt/sysimage/ --install /mnt/sr1/pool/main/z/zsh*.deb dpkg: error: cannot access archive '/mnt/sr1/pool/main/z/zsh*.deb': No such file or directory root@ubuntu:/mnt/sr1# dpkg --root=/mnt/sysimage/ --install /mnt/sr1/pool/main/z/zsh/zsh*.deb Selecting previously unselected package zsh. (Reading database ... 211566 files and directories currently installed.) Preparing to unpack .../z/zsh/zsh_5.9-4+b5_amd64.deb ... Unpacking zsh (5.9-4+b5) ... Selecting previously unselected package zsh-common. Preparing to unpack .../z/zsh/zsh-common_5.9-4_all.deb ... Unpacking zsh-common (5.9-4) ... Setting up zsh-common (5.9-4) ... Setting up zsh (5.9-4+b5) ... Processing triggers for debianutils (5.17build1) ... Processing triggers for man-db (2.12.0-4build2) ... root@ubuntu:/mnt/sr1#
- Remove the Ubuntu install media and reboot the system.
Thanks again, Luis!
Best wishes,
Urs1 -
Hi Urs, it's a pleasure! I'm glad you were able to do it on Ubuntu/Debian.
Regards,
Luis.0
Categories
- All Categories
- 238 LFX Mentorship
- 238 LFX Mentorship: Linux Kernel
- 813 Linux Foundation IT Professional Programs
- 366 Cloud Engineer IT Professional Program
- 183 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 129 Cloud Native Developer IT Professional Program
- 142 Express Training Courses & Microlearning
- 142 Express Courses - Discussion Forum
- Microlearning - Discussion Forum
- 6.5K Training Courses
- 40 LFC110 Class Forum - Discontinued
- 66 LFC131 Class Forum
- 49 LFD102 Class Forum
- 233 LFD103 Class Forum
- 16 LFD110 Class Forum
- 29 LFD121 Class Forum
- LFD123 Class Forum
- LFD125 Class Forum
- 16 LFD133 Class Forum
- 6 LFD134 Class Forum
- 18 LFD137 Class Forum
- 70 LFD201 Class Forum
- 3 LFD210 Class Forum
- 2 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 718 LFD259 Class Forum
- 111 LFD272 Class Forum - Discontinued
- 3 LFD272-JP クラス フォーラム
- 13 LFD273 Class Forum
- 222 LFS101 Class Forum
- 1 LFS111 Class Forum
- 2 LFS112 Class Forum
- 1 LFS116 Class Forum
- 3 LFS118 Class Forum
- LFS120 Class Forum
- 1 LFS142 Class Forum
- 2 LFS144 Class Forum
- 3 LFS145 Class Forum
- 4 LFS146 Class Forum
- 15 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 55 LFS158 Class Forum
- LFS158-JP クラス フォーラム
- 4 LFS162 Class Forum
- 1 LFS166 Class Forum
- 2 LFS167 Class Forum
- 3 LFS170 Class Forum
- 1 LFS171 Class Forum
- 1 LFS178 Class Forum
- 2 LFS180 Class Forum
- 1 LFS182 Class Forum
- 3 LFS183 Class Forum
- 30 LFS200 Class Forum
- 737 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 20 LFS203 Class Forum
- 109 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 2 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 53 LFS241 Class Forum
- 43 LFS242 Class Forum
- 37 LFS243 Class Forum
- 16 LFS244 Class Forum
- 1 LFS245 Class Forum
- LFS246 Class Forum
- LFS248 Class Forum
- 44 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 156 LFS253 Class Forum
- LFS254 Class Forum
- 2 LFS255 Class Forum
- 6 LFS256 Class Forum
- LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 9 LFS258-JP クラス フォーラム
- 113 LFS260 Class Forum
- 161 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 21 LFS267 Class Forum
- 18 LFS268 Class Forum
- 29 LFS269 Class Forum
- 7 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- 2 LFS147 Class Forum
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 2 LFW111 Class Forum
- 257 LFW211 Class Forum
- 176 LFW212 Class Forum
- 15 SKF100 Class Forum
- SKF200 Class Forum
- 2 SKF201 Class Forum
- 797 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 752 Linux Distributions
- 82 Debian
- 67 Fedora
- 16 Linux Mint
- 13 Mageia
- 23 openSUSE
- 147 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 349 Ubuntu
- 463 Linux System Administration
- 39 Cloud Computing
- 71 Command Line/Scripting
- Github systems admin projects
- 91 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 55 Mobile Computing
- 18 Android
- 28 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 364 Off Topic
- 115 Introductions
- 170 Small Talk
- 26 Study Material
- 518 Programming and Development
- 304 Kernel Development
- 211 Software Development
- 1.1K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 311 Installation
- 78 All In Program
- 78 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)