Title
How to create a bootable Ubuntu USB flash drive from terminal?
There are built-in text mode tools, that you can run from a text screen or a terminal window. dd
or cp
or cat
can be used, but they are not safe because they do what you tell them to do without any question, and a minor typing error is enough to overwrite a drive with valuable data.
Fortunately there are also safer text mode tools, but you have to install them.
Install mkusb via its PPA: If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)
sudo add-apt-repository universe # only for standard Ubuntu
sudo add-apt-repository ppa:mkusb/ppa # and press Enter
sudo apt-get update
sudo apt-get install dus mkusb-nox usb-pack-efi
Installing this way will add not only dus
and mkusb-nox
but also some program packages that mkusb depends on. (If you try to install the whole mkusb program package, it also wants to bring some tools that need a graphic environment.)
If you want a small tool or if you don't like PPAs or don't want any extra program packages, you can use mkusb-min. This shellscript is very small compared to the other versions, yet it serves the purpose to wrap a safety belt around dd
.
$ wc mkusb-min
208 736 5435 mkusb-min
It should be rather easy to see what the shellscript is doing simply by reading it in a text editor.
Download mkusb-min from its Ubuntu help page. Run it locally or install it into a directory in PATH
.
xorriso-dd-target is a new tool, intended to be uploaded to a Debian repository. The purpose is to make it very safe to create boot drives (USB pendrives or memory cards). A special feature is the plug-in method to identify the target device. The man page is available here. In January 2020 there is not yet any installer, but you can copy and paste from the links above and install the shellscript and man page manually.
Finally I want to mention bootiso which is described by its developer in another answer.
Question
Is there any way to create a bootable Ubuntu USB flash drive from the
terminal without using any third-party applications like YUMI,
Unetbootin, Startup Disk Creator, etc.
If we must look for text mode tools that are already installed in Ubuntu, I am afraid that there are no safe tools available. So in this case I can only suggest that you use dd
or cp
or cat
according to many of the other answers here. But please check and double-check that you are really pointing to the intended target device before pressing the Enter key.
(By the way, the Ubuntu Startup Disk Creator belongs to Ubuntu (is not third party), but it needs a graphical desktop environment or at least a graphical window manager.)