Sithuk / ubuntu-server-zfsbootmenu

Ubuntu zfsbootmenu install script
123 stars 28 forks source link

sed: -e expression #1, char 2: unterminated address regex #17

Closed 10101010101010001 closed 1 year ago

10101010101010001 commented 1 year ago

Using Ubuntu 22.04.1 Server Installer. Error: sed: -e expression #1, char 2: unterminated address regex

How we fixed it: ubuntu_original="$(grep -v 'security|cdrom' /etc/apt/sources.list | awk 'NF>=2{ print $2 }' | sort -u)"

Sithuk commented 1 year ago

Thank you for the feedback. I don't get that error with the script. When I try the command you've written, it doesn't give the answer it should: http://archive.ubuntu.com/ubuntu/ The code in the script does: ubuntu_original="$(grep -v 'security|cdrom' /etc/apt/sources.list | awk '{ print $2 }' | sort -u)"

What was the content of your /etc/apt/sources.list before running the script? Could you share the installation log?

10101010101010001 commented 1 year ago

root@ubuntu-server:\~/ubuntu-server-zfsbootmenu# ubuntu_original="$(grep -v 'security|cdrom' /etc/apt/sources.list | awk '{ print $2 }' | sort -u)" root@ubuntu-server:\~/ubuntu-server-zfsbootmenu# echo $ubuntu_original Also, Major N.B. See deb-src distribution. extensively http://archive.ubuntu.com/ubuntu/ multiverse newer team, team. your root@ubuntu-server:~/ubuntu-server-zfsbootmenu# sed -i -e "\,${ubuntu_original}, s,main restricted,main restricted universe multiverse," /etc/apt/sources.list sed: -e expression #1, char 2: unterminated address regex

/etc/apt/sources.list # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb cdrom:[Ubuntu-Server 22.04.1 LTS Jammy Jellyfish - Release amd64 (20220809)]/ jammy main restricted deb http://archive.ubuntu.com/ubuntu/ jammy main restricted # deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted # deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ jammy universe # deb-src http://archive.ubuntu.com/ubuntu/ jammy universe deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe # deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://archive.ubuntu.com/ubuntu/ jammy multiverse # deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse # deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse # deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted # deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted deb http://security.ubuntu.com/ubuntu/ jammy-security universe # deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse # deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse

Sithuk commented 1 year ago

I've just checked the content of the /etc/apt/sources.list file in the Ubuntu 22.04 live iso and it is:

deb cdrom:[Ubuntu 22.04 LTS Jammy Jellyfish - Release amd64 (20220419)]/ jammy main restricted deb http://archive.ubuntu.com/ubuntu/ jammy main restricted deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted

Your log paste above (root@ubuntu-server) suggests you aren't in an ubuntu live desktop environment. The script needs to be run from an ubuntu live desktop environment. Which environment are you running the script from? What do you get when you run the following. dpkg -l ubuntu-desktop cat /proc/cmdline

Sithuk commented 1 year ago

I've updated the script with a check for the installation environment. Could you try the updated script and let me know what happens?

Sithuk commented 1 year ago

It looks like you are using the ubuntu server iso instead of the ubuntu desktop iso. I don't think zfsutils is present in the server iso so unless you installed it separately then the initial install shouldn't have worked?

10101010101010001 commented 1 year ago

You are right I was using the ubuntu server 22.04.1 iso. It's possible to use 22.04.1 to perform the install. My apologize for my lack of attention to detail and thanks for your help. Cheers

10101010101010001 commented 1 year ago

I've updated the script with a check for the installation environment. Could you try the updated script and let me know what happens?

dpkg-query: no packages found matching ubuntu-desktop

Sithuk commented 1 year ago

That's good news, thank you for letting me know. I didn't think the server iso came with the zfs software installed. I'll have another look at the latest version.

"dpkg-query: no packages found matching ubuntu-desktop" So the check worked on the server iso?

Sithuk commented 1 year ago

I just tested an install with the ubuntu server 22.04 iso. You're right that once the issue with the apt sources.list is resolved then the script runs fine on it.

I'm going to leave in the requirement to use the ubuntu desktop live iso as an install envionment though. It makes testing significantly easier to restrict the install environments.