Are there commands to install Ubuntu from USB? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I currently have Q4os installed.



What command can I use to install Lubuntu from files on USB? I can't boot install from USB and mini install doesn't have wireless internet installed.







share|improve this question














closed as off-topic by dessert, Fabby, anonymous2, waltinator, dpb Apr 27 at 4:48


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – dessert, Fabby, anonymous2, waltinator
If this question can be reworded to fit the rules in the help center, please edit the question.












  • Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
    – C.S.Cameron
    Apr 21 at 22:45










  • This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
    – vidarlo
    Apr 22 at 15:42











  • @vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
    – Rinzwind
    Apr 22 at 17:41






  • 1




    @Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
    – vidarlo
    Apr 22 at 18:05










  • Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
    – dpb
    Apr 27 at 4:47














up vote
0
down vote

favorite












I currently have Q4os installed.



What command can I use to install Lubuntu from files on USB? I can't boot install from USB and mini install doesn't have wireless internet installed.







share|improve this question














closed as off-topic by dessert, Fabby, anonymous2, waltinator, dpb Apr 27 at 4:48


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – dessert, Fabby, anonymous2, waltinator
If this question can be reworded to fit the rules in the help center, please edit the question.












  • Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
    – C.S.Cameron
    Apr 21 at 22:45










  • This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
    – vidarlo
    Apr 22 at 15:42











  • @vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
    – Rinzwind
    Apr 22 at 17:41






  • 1




    @Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
    – vidarlo
    Apr 22 at 18:05










  • Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
    – dpb
    Apr 27 at 4:47












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I currently have Q4os installed.



What command can I use to install Lubuntu from files on USB? I can't boot install from USB and mini install doesn't have wireless internet installed.







share|improve this question














I currently have Q4os installed.



What command can I use to install Lubuntu from files on USB? I can't boot install from USB and mini install doesn't have wireless internet installed.









share|improve this question













share|improve this question




share|improve this question








edited Apr 22 at 17:36









Zanna

48k13119227




48k13119227










asked Apr 21 at 21:39









user819417

62




62




closed as off-topic by dessert, Fabby, anonymous2, waltinator, dpb Apr 27 at 4:48


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – dessert, Fabby, anonymous2, waltinator
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by dessert, Fabby, anonymous2, waltinator, dpb Apr 27 at 4:48


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – dessert, Fabby, anonymous2, waltinator
If this question can be reworded to fit the rules in the help center, please edit the question.











  • Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
    – C.S.Cameron
    Apr 21 at 22:45










  • This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
    – vidarlo
    Apr 22 at 15:42











  • @vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
    – Rinzwind
    Apr 22 at 17:41






  • 1




    @Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
    – vidarlo
    Apr 22 at 18:05










  • Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
    – dpb
    Apr 27 at 4:47
















  • Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
    – C.S.Cameron
    Apr 21 at 22:45










  • This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
    – vidarlo
    Apr 22 at 15:42











  • @vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
    – Rinzwind
    Apr 22 at 17:41






  • 1




    @Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
    – vidarlo
    Apr 22 at 18:05










  • Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
    – dpb
    Apr 27 at 4:47















Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
– C.S.Cameron
Apr 21 at 22:45




Q4OS is Debian based, it might support mkusb which is a great tool for making an installer USB.
– C.S.Cameron
Apr 21 at 22:45












This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
– vidarlo
Apr 22 at 15:42





This is not a duplicate of either of the questions it's marked as duplicate of in my opinion. The question is how to install Ubuntu from within q4OS as I read it.
– vidarlo
Apr 22 at 15:42













@vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
– Rinzwind
Apr 22 at 17:41




@vidarlo I would consider that off topic. We can't be expected to know how Q4OS works.
– Rinzwind
Apr 22 at 17:41




1




1




@Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
– vidarlo
Apr 22 at 18:05




@Rinzwind Off topic would be a valid close reason... But the dupes was not a valid close reason.
– vidarlo
Apr 22 at 18:05












Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
– dpb
Apr 27 at 4:47




Why can't you "boot install from USB"? Add this detail to your question, and I'm sure someone would be happy to help.
– dpb
Apr 27 at 4:47










1 Answer
1






active

oldest

votes

















up vote
3
down vote













You may, using debootstrap. This is not for the faint of heart, as it is mostly a manual procedure, but it's absolutely possible.



First you will have to make space. Shrink one of the existing partitions, so you have at least a gigabyte or three for Ubuntu. This can be increased later, when you have booted into Ubuntu, and are ready to remove your current OS. gparted is a nice GUI tool for working with partitions.



Next, mount your new partition somewhere nice. I will use /mnt for this in this text.



Also run the following command, and save the UUID for later! Substitute sdb1 for whatever partition you set up.



$ sudo blkid /dev/sdb1
/dev/sdb1: LABEL="ubuntu" UUID="a15e52e5-a5e3-4643-a657-43ce87f9aa00" TYPE="ext4"


Getting debootstrap



At this stage I assumed /mnt/ is mounted.



First step is to download debootstrap. At the time of writing, debootstrap_1.0.95.tar.gz is the latest version:



[/tmp]$ wget "http://ports.ubuntu.com/ubuntu-ports/pool/main/d/debootstrap/debootstrap_1.0.95.tar.gz"
[/tmp]$ tar zxf debootstrap_1.0.95.tar.gz
[/tmp]$ cd debootstrap-1.0.95/
[/tmp/debootstrap-1.0.95]$ export DEBOOTSTRAP_DIR=`pwd`
[/tmp/debootstrap-1.0.95]$ sudo DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch=amd64 xenial /mnt http://archive.ubuntu.com/ubuntu
[removed lots of output of debootstrap fetching packages]


This step takes some time, as the base system is downloaded and unpacked into /mnt. It should end with I: Base system installed successfully.



Then we need to bind mount some system directories, so information about the machine is available inside the chroot:



# sudo mount -o bind /dev /mnt/dev
# sudo mount -o bind /dev/pts /mnt/dev/pts
# sudo mount -t sysfs /sys /mnt/sys
# sudo mount -t proc /proc /mnt/proc


chroot into the new system



[/tmp/debootstrap-1.0.95]$ sudo chroot /mnt
root@hannah:/#


This is a functioning Ubuntu system, albeit a minimal one.
First step is probably to install a few packages, such as nano.
You will get error messages complaining that devices are unavailable and so forth. This is normal. Ignore them.



All commands from now on is run inside the chroot environment.



Mount the virtual /proc and /sys fs:
# mount -t proc proc /proc
# mount -t sysfs sysfs /sys



Configure fstab



The fstab is blank. Edit it with nano:



# nano /etc/fstab


Add a line like



UUID=a15e52e5-a5e3-4643-a657-43ce87f9aa00 / ext4 errors=remount-ro 0 1


where the UUID is the one you saved above.



Update your system



# echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list
# echo "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
# echo "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
# apt-get update && apt-get upgrade


Time to install a kernel!



# apt-cache search linux-image


will list available kernels. Pick a suitable one. For me this was linux-image-4.8.0-58-generic, which was installed with



# apt-get install linux-image-4.8.0-58-generic


This should ask you where you want to install the bootloader. This is typically the main drive, /dev/sda or similar. This will overwrite your current bootloader and make your current system unbootable!



Adding a user



# adduser foo
##Answer adduser with password, name and so on
# usermod -aG sudo username


The last command will add sudo permissions for the user.



Misc things to configure



You probably want to configure those items.



Timezone:



# dpkg-reconfigure tzdata


Locales:



# dpkg-reconfigure locales



Install lubuntu-desktop



# apt-get lubuntu-desktop


This will install the meta-package lubuntu-desktop which depends on all you need for a standard lubuntu desktop. This takes a little while, as it is many packages. This will probably fail, as blueman will refuse to work without a running, proper system. Ignore it, and remove it with apt-get remove blueman.



This should be more or less it. Reboot into your new system, and log in.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    You may, using debootstrap. This is not for the faint of heart, as it is mostly a manual procedure, but it's absolutely possible.



    First you will have to make space. Shrink one of the existing partitions, so you have at least a gigabyte or three for Ubuntu. This can be increased later, when you have booted into Ubuntu, and are ready to remove your current OS. gparted is a nice GUI tool for working with partitions.



    Next, mount your new partition somewhere nice. I will use /mnt for this in this text.



    Also run the following command, and save the UUID for later! Substitute sdb1 for whatever partition you set up.



    $ sudo blkid /dev/sdb1
    /dev/sdb1: LABEL="ubuntu" UUID="a15e52e5-a5e3-4643-a657-43ce87f9aa00" TYPE="ext4"


    Getting debootstrap



    At this stage I assumed /mnt/ is mounted.



    First step is to download debootstrap. At the time of writing, debootstrap_1.0.95.tar.gz is the latest version:



    [/tmp]$ wget "http://ports.ubuntu.com/ubuntu-ports/pool/main/d/debootstrap/debootstrap_1.0.95.tar.gz"
    [/tmp]$ tar zxf debootstrap_1.0.95.tar.gz
    [/tmp]$ cd debootstrap-1.0.95/
    [/tmp/debootstrap-1.0.95]$ export DEBOOTSTRAP_DIR=`pwd`
    [/tmp/debootstrap-1.0.95]$ sudo DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch=amd64 xenial /mnt http://archive.ubuntu.com/ubuntu
    [removed lots of output of debootstrap fetching packages]


    This step takes some time, as the base system is downloaded and unpacked into /mnt. It should end with I: Base system installed successfully.



    Then we need to bind mount some system directories, so information about the machine is available inside the chroot:



    # sudo mount -o bind /dev /mnt/dev
    # sudo mount -o bind /dev/pts /mnt/dev/pts
    # sudo mount -t sysfs /sys /mnt/sys
    # sudo mount -t proc /proc /mnt/proc


    chroot into the new system



    [/tmp/debootstrap-1.0.95]$ sudo chroot /mnt
    root@hannah:/#


    This is a functioning Ubuntu system, albeit a minimal one.
    First step is probably to install a few packages, such as nano.
    You will get error messages complaining that devices are unavailable and so forth. This is normal. Ignore them.



    All commands from now on is run inside the chroot environment.



    Mount the virtual /proc and /sys fs:
    # mount -t proc proc /proc
    # mount -t sysfs sysfs /sys



    Configure fstab



    The fstab is blank. Edit it with nano:



    # nano /etc/fstab


    Add a line like



    UUID=a15e52e5-a5e3-4643-a657-43ce87f9aa00 / ext4 errors=remount-ro 0 1


    where the UUID is the one you saved above.



    Update your system



    # echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list
    # echo "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
    # echo "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
    # apt-get update && apt-get upgrade


    Time to install a kernel!



    # apt-cache search linux-image


    will list available kernels. Pick a suitable one. For me this was linux-image-4.8.0-58-generic, which was installed with



    # apt-get install linux-image-4.8.0-58-generic


    This should ask you where you want to install the bootloader. This is typically the main drive, /dev/sda or similar. This will overwrite your current bootloader and make your current system unbootable!



    Adding a user



    # adduser foo
    ##Answer adduser with password, name and so on
    # usermod -aG sudo username


    The last command will add sudo permissions for the user.



    Misc things to configure



    You probably want to configure those items.



    Timezone:



    # dpkg-reconfigure tzdata


    Locales:



    # dpkg-reconfigure locales



    Install lubuntu-desktop



    # apt-get lubuntu-desktop


    This will install the meta-package lubuntu-desktop which depends on all you need for a standard lubuntu desktop. This takes a little while, as it is many packages. This will probably fail, as blueman will refuse to work without a running, proper system. Ignore it, and remove it with apt-get remove blueman.



    This should be more or less it. Reboot into your new system, and log in.






    share|improve this answer


























      up vote
      3
      down vote













      You may, using debootstrap. This is not for the faint of heart, as it is mostly a manual procedure, but it's absolutely possible.



      First you will have to make space. Shrink one of the existing partitions, so you have at least a gigabyte or three for Ubuntu. This can be increased later, when you have booted into Ubuntu, and are ready to remove your current OS. gparted is a nice GUI tool for working with partitions.



      Next, mount your new partition somewhere nice. I will use /mnt for this in this text.



      Also run the following command, and save the UUID for later! Substitute sdb1 for whatever partition you set up.



      $ sudo blkid /dev/sdb1
      /dev/sdb1: LABEL="ubuntu" UUID="a15e52e5-a5e3-4643-a657-43ce87f9aa00" TYPE="ext4"


      Getting debootstrap



      At this stage I assumed /mnt/ is mounted.



      First step is to download debootstrap. At the time of writing, debootstrap_1.0.95.tar.gz is the latest version:



      [/tmp]$ wget "http://ports.ubuntu.com/ubuntu-ports/pool/main/d/debootstrap/debootstrap_1.0.95.tar.gz"
      [/tmp]$ tar zxf debootstrap_1.0.95.tar.gz
      [/tmp]$ cd debootstrap-1.0.95/
      [/tmp/debootstrap-1.0.95]$ export DEBOOTSTRAP_DIR=`pwd`
      [/tmp/debootstrap-1.0.95]$ sudo DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch=amd64 xenial /mnt http://archive.ubuntu.com/ubuntu
      [removed lots of output of debootstrap fetching packages]


      This step takes some time, as the base system is downloaded and unpacked into /mnt. It should end with I: Base system installed successfully.



      Then we need to bind mount some system directories, so information about the machine is available inside the chroot:



      # sudo mount -o bind /dev /mnt/dev
      # sudo mount -o bind /dev/pts /mnt/dev/pts
      # sudo mount -t sysfs /sys /mnt/sys
      # sudo mount -t proc /proc /mnt/proc


      chroot into the new system



      [/tmp/debootstrap-1.0.95]$ sudo chroot /mnt
      root@hannah:/#


      This is a functioning Ubuntu system, albeit a minimal one.
      First step is probably to install a few packages, such as nano.
      You will get error messages complaining that devices are unavailable and so forth. This is normal. Ignore them.



      All commands from now on is run inside the chroot environment.



      Mount the virtual /proc and /sys fs:
      # mount -t proc proc /proc
      # mount -t sysfs sysfs /sys



      Configure fstab



      The fstab is blank. Edit it with nano:



      # nano /etc/fstab


      Add a line like



      UUID=a15e52e5-a5e3-4643-a657-43ce87f9aa00 / ext4 errors=remount-ro 0 1


      where the UUID is the one you saved above.



      Update your system



      # echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list
      # echo "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
      # echo "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
      # apt-get update && apt-get upgrade


      Time to install a kernel!



      # apt-cache search linux-image


      will list available kernels. Pick a suitable one. For me this was linux-image-4.8.0-58-generic, which was installed with



      # apt-get install linux-image-4.8.0-58-generic


      This should ask you where you want to install the bootloader. This is typically the main drive, /dev/sda or similar. This will overwrite your current bootloader and make your current system unbootable!



      Adding a user



      # adduser foo
      ##Answer adduser with password, name and so on
      # usermod -aG sudo username


      The last command will add sudo permissions for the user.



      Misc things to configure



      You probably want to configure those items.



      Timezone:



      # dpkg-reconfigure tzdata


      Locales:



      # dpkg-reconfigure locales



      Install lubuntu-desktop



      # apt-get lubuntu-desktop


      This will install the meta-package lubuntu-desktop which depends on all you need for a standard lubuntu desktop. This takes a little while, as it is many packages. This will probably fail, as blueman will refuse to work without a running, proper system. Ignore it, and remove it with apt-get remove blueman.



      This should be more or less it. Reboot into your new system, and log in.






      share|improve this answer
























        up vote
        3
        down vote










        up vote
        3
        down vote









        You may, using debootstrap. This is not for the faint of heart, as it is mostly a manual procedure, but it's absolutely possible.



        First you will have to make space. Shrink one of the existing partitions, so you have at least a gigabyte or three for Ubuntu. This can be increased later, when you have booted into Ubuntu, and are ready to remove your current OS. gparted is a nice GUI tool for working with partitions.



        Next, mount your new partition somewhere nice. I will use /mnt for this in this text.



        Also run the following command, and save the UUID for later! Substitute sdb1 for whatever partition you set up.



        $ sudo blkid /dev/sdb1
        /dev/sdb1: LABEL="ubuntu" UUID="a15e52e5-a5e3-4643-a657-43ce87f9aa00" TYPE="ext4"


        Getting debootstrap



        At this stage I assumed /mnt/ is mounted.



        First step is to download debootstrap. At the time of writing, debootstrap_1.0.95.tar.gz is the latest version:



        [/tmp]$ wget "http://ports.ubuntu.com/ubuntu-ports/pool/main/d/debootstrap/debootstrap_1.0.95.tar.gz"
        [/tmp]$ tar zxf debootstrap_1.0.95.tar.gz
        [/tmp]$ cd debootstrap-1.0.95/
        [/tmp/debootstrap-1.0.95]$ export DEBOOTSTRAP_DIR=`pwd`
        [/tmp/debootstrap-1.0.95]$ sudo DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch=amd64 xenial /mnt http://archive.ubuntu.com/ubuntu
        [removed lots of output of debootstrap fetching packages]


        This step takes some time, as the base system is downloaded and unpacked into /mnt. It should end with I: Base system installed successfully.



        Then we need to bind mount some system directories, so information about the machine is available inside the chroot:



        # sudo mount -o bind /dev /mnt/dev
        # sudo mount -o bind /dev/pts /mnt/dev/pts
        # sudo mount -t sysfs /sys /mnt/sys
        # sudo mount -t proc /proc /mnt/proc


        chroot into the new system



        [/tmp/debootstrap-1.0.95]$ sudo chroot /mnt
        root@hannah:/#


        This is a functioning Ubuntu system, albeit a minimal one.
        First step is probably to install a few packages, such as nano.
        You will get error messages complaining that devices are unavailable and so forth. This is normal. Ignore them.



        All commands from now on is run inside the chroot environment.



        Mount the virtual /proc and /sys fs:
        # mount -t proc proc /proc
        # mount -t sysfs sysfs /sys



        Configure fstab



        The fstab is blank. Edit it with nano:



        # nano /etc/fstab


        Add a line like



        UUID=a15e52e5-a5e3-4643-a657-43ce87f9aa00 / ext4 errors=remount-ro 0 1


        where the UUID is the one you saved above.



        Update your system



        # echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list
        # echo "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
        # echo "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
        # apt-get update && apt-get upgrade


        Time to install a kernel!



        # apt-cache search linux-image


        will list available kernels. Pick a suitable one. For me this was linux-image-4.8.0-58-generic, which was installed with



        # apt-get install linux-image-4.8.0-58-generic


        This should ask you where you want to install the bootloader. This is typically the main drive, /dev/sda or similar. This will overwrite your current bootloader and make your current system unbootable!



        Adding a user



        # adduser foo
        ##Answer adduser with password, name and so on
        # usermod -aG sudo username


        The last command will add sudo permissions for the user.



        Misc things to configure



        You probably want to configure those items.



        Timezone:



        # dpkg-reconfigure tzdata


        Locales:



        # dpkg-reconfigure locales



        Install lubuntu-desktop



        # apt-get lubuntu-desktop


        This will install the meta-package lubuntu-desktop which depends on all you need for a standard lubuntu desktop. This takes a little while, as it is many packages. This will probably fail, as blueman will refuse to work without a running, proper system. Ignore it, and remove it with apt-get remove blueman.



        This should be more or less it. Reboot into your new system, and log in.






        share|improve this answer














        You may, using debootstrap. This is not for the faint of heart, as it is mostly a manual procedure, but it's absolutely possible.



        First you will have to make space. Shrink one of the existing partitions, so you have at least a gigabyte or three for Ubuntu. This can be increased later, when you have booted into Ubuntu, and are ready to remove your current OS. gparted is a nice GUI tool for working with partitions.



        Next, mount your new partition somewhere nice. I will use /mnt for this in this text.



        Also run the following command, and save the UUID for later! Substitute sdb1 for whatever partition you set up.



        $ sudo blkid /dev/sdb1
        /dev/sdb1: LABEL="ubuntu" UUID="a15e52e5-a5e3-4643-a657-43ce87f9aa00" TYPE="ext4"


        Getting debootstrap



        At this stage I assumed /mnt/ is mounted.



        First step is to download debootstrap. At the time of writing, debootstrap_1.0.95.tar.gz is the latest version:



        [/tmp]$ wget "http://ports.ubuntu.com/ubuntu-ports/pool/main/d/debootstrap/debootstrap_1.0.95.tar.gz"
        [/tmp]$ tar zxf debootstrap_1.0.95.tar.gz
        [/tmp]$ cd debootstrap-1.0.95/
        [/tmp/debootstrap-1.0.95]$ export DEBOOTSTRAP_DIR=`pwd`
        [/tmp/debootstrap-1.0.95]$ sudo DEBOOTSTRAP_DIR=`pwd` ./debootstrap --arch=amd64 xenial /mnt http://archive.ubuntu.com/ubuntu
        [removed lots of output of debootstrap fetching packages]


        This step takes some time, as the base system is downloaded and unpacked into /mnt. It should end with I: Base system installed successfully.



        Then we need to bind mount some system directories, so information about the machine is available inside the chroot:



        # sudo mount -o bind /dev /mnt/dev
        # sudo mount -o bind /dev/pts /mnt/dev/pts
        # sudo mount -t sysfs /sys /mnt/sys
        # sudo mount -t proc /proc /mnt/proc


        chroot into the new system



        [/tmp/debootstrap-1.0.95]$ sudo chroot /mnt
        root@hannah:/#


        This is a functioning Ubuntu system, albeit a minimal one.
        First step is probably to install a few packages, such as nano.
        You will get error messages complaining that devices are unavailable and so forth. This is normal. Ignore them.



        All commands from now on is run inside the chroot environment.



        Mount the virtual /proc and /sys fs:
        # mount -t proc proc /proc
        # mount -t sysfs sysfs /sys



        Configure fstab



        The fstab is blank. Edit it with nano:



        # nano /etc/fstab


        Add a line like



        UUID=a15e52e5-a5e3-4643-a657-43ce87f9aa00 / ext4 errors=remount-ro 0 1


        where the UUID is the one you saved above.



        Update your system



        # echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list
        # echo "deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse" >> /etc/apt/sources.list
        # echo "deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse" >> /etc/apt/sources.list
        # apt-get update && apt-get upgrade


        Time to install a kernel!



        # apt-cache search linux-image


        will list available kernels. Pick a suitable one. For me this was linux-image-4.8.0-58-generic, which was installed with



        # apt-get install linux-image-4.8.0-58-generic


        This should ask you where you want to install the bootloader. This is typically the main drive, /dev/sda or similar. This will overwrite your current bootloader and make your current system unbootable!



        Adding a user



        # adduser foo
        ##Answer adduser with password, name and so on
        # usermod -aG sudo username


        The last command will add sudo permissions for the user.



        Misc things to configure



        You probably want to configure those items.



        Timezone:



        # dpkg-reconfigure tzdata


        Locales:



        # dpkg-reconfigure locales



        Install lubuntu-desktop



        # apt-get lubuntu-desktop


        This will install the meta-package lubuntu-desktop which depends on all you need for a standard lubuntu desktop. This takes a little while, as it is many packages. This will probably fail, as blueman will refuse to work without a running, proper system. Ignore it, and remove it with apt-get remove blueman.



        This should be more or less it. Reboot into your new system, and log in.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 22 at 17:31


























        community wiki





        2 revs
        vidarlo













            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491