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
- 175 LFX Mentorship
- 175 LFX Mentorship: Linux Kernel
- 745 Linux Foundation IT Professional Programs
- 372 Cloud Engineer IT Professional Program
- 168 Advanced Cloud Engineer IT Professional Program
- 73 DevOps IT Professional Program - Discontinued
- 3 DevOps & GitOps IT Professional Program
- 98 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- AI & ML Training
- Blockchain & Decentralized Identity Training
- Cloud & Containers Training
- Cybersecurity Training
- DevOps & Site-Reliability Training
- Linux Kernel Development Training
- Networking Training
- Open Source Best Practice Training
- System Administration Training
- System Engineering Training
- Web & Application Development Training
- 2 LFD103-JP クラス フォーラム
- 4 LFD210-CN Class Forum
- 764 LFD259 Class Forum
- 681 LFS101 Class Forum
- 2 LFS158-JP クラス フォーラム
- 162 LFS207 Class Forum
- 3 LFS207-DE-Klassenforum
- 4 LFS207-JP クラス フォーラム
- 61 LFS241 Class Forum
- 52 LFS242 Class Forum
- 42 LFS243 Class Forum
- 19 LFS244 Class Forum
- 4 LFS250-JP クラス フォーラム
- 166 LFS253 Class Forum
- 19 LFS256 Class Forum
- 1.4K LFS258 Class Forum
- 165 LFS261 Class Forum
- 26 LFS267 Class Forum
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 768 Linux Distributions
- 81 Debian
- 67 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 944 Programming and Development
- 310 Kernel Development
- 616 Software Development
- 977 Software
- 369 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class 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)