Score:0

Format or leave my ubuntu terminal WSL without any packages?

cn flag

It is obvious that when installing wsl, along with the Ubuntu distribution, it comes with pre-installed packages, such as git, curl, wget, etc., however I would like to have it like the classic ubuntu just installed, without these specific packages and ready to start installing the ones you need, I know that Ubuntu is not like other distributions that can arrive without any package completely at zero, but at least I would like it to be as I said a vanilla Ubuntu Does anyone know any command to do this? That is, reset the entire terminal

Or the way to install it as I tell you?

Since I want to install these packages in their latest version for example, or others I do not even want to install them.

ChanganAuto avatar
us flag
All preinstalled packages are part of the Ubuntu distro. There's a "minimal" installation media that allows building up from there but that's certainly NOT applicable to WSL.
Nmath avatar
ng flag
I'm not sure what you are asking... These packages typically come with Ubuntu. If you don't want the WSL version of Ubuntu, you should install Ubuntu on bare metal in dual boot configuration or you could install Ubuntu in a VM like VirtualBox. Ubuntu "without any packages" is not possible and wouldn't be a functioning system in any capacity...
user535733 avatar
cn flag
"*like the classic ubuntu just installed*" may have meaning to you, but not to us. You must explain more clearly what you want.
oeuioeuipPEO avatar
cn flag
@Nmath The reason why I ask is why I use ubuntu in a virtual machine, the same version 20.04 LTS, and this when executing the command, for example git init, it told me that the command is unknown, followed by installing it and everything was great with the latest version, since WSL with Ubuntu comes to me with outdated versions.
oeuioeuipPEO avatar
cn flag
Yesterday I reinstalled it, and I wanted to do a git config --global init.defaultBranch BranchName, and it did not let me, since it was in an old version of git, and I pass with other pre-installed packages as well
oeuioeuipPEO avatar
cn flag
@ChanganAuto So is there a way to uninstall all these pre-installed packages, with just a few commands?
oeuioeuipPEO avatar
cn flag
@user535733 The newly installed iso 20.04LTS from the Ubuntu official page, and sorry for the inconvenience, I am not that experienced in Ubuntu
Nmath avatar
ng flag
Based on your comments, this is an [XY problem](https://meta.stackexchange.com/a/66378). You should ask about the actual problem(s) that you face. Not a proposed solution. In this case your question doesn't make any sense as asked. I suggest that you close this question and then ask a new question for each problem that you would like to solve.
user535733 avatar
cn flag
A stock install of Ubuntu is made up of thousands of packages. Those package are not *additions* to the OS, they are the *fundamental components* of the OS. Like a house made of Lego blocks. That's why we don't understand your question: Without the pre-installed packages, there is nothing left.
Score:0
vn flag

It's unclear what you mean by "Vanilla Ubuntu". There are really multiple Ubuntu installation options, including, but not limited to:

  • Desktop
  • Server
  • Flavors
  • WSL
  • Base

Each of these has a different set of default packages. The WSL installation, IMHO, is pretty close to the Server installation. There are some differences in default packages. If I recall correctly, Git is not installed by default with Server, but wget and curl (IIRC) are. Since the "normal" Server tarball comes in a few dozen MBs larger than that of WSL, there are certainly some packages there that are removed from the WSL version.

The WSL installation also includes the wslu (WSL utilities) package by default.

I'm assuming you don't mean the Desktop distribution, since WSL doesn't (currently) include a GUI, and that would be very package-heavy.

If you really want the Base installation, with no extra packages by default, WSL does include the ability to import custom distributions.

Public Service Announcement: This is designed for advanced users. Even the very basics like locale and readline aren't installed by default here. You'll need to pretty much install and configure everything that would already be provided for you in the WSL version.

But if that's what you want ...

Short instructions. From PowerShell or CMD:

  • Create a directory for the installation on Windows (e.g. C:\Users\your_user\Documents\WSL\UbuntuBase)
  • Download ubuntu-base-20.04.1-base-amd64.tar.gz to C:\Users\your_user\Documents\WSL\
  • From within that directory, wsl --import UbuntuBase .\UbuntuBase ubuntu-base-20.04.1-base-amd64.tar.gz --version 2 (see wsl --help for details on each argument)
  • wsl ~ -d UbuntuBase to run the distribution
  • To set it as default, wsl --set-default UbuntuBase. After that, just running wsl will start that version.

Eventually, you'll also need to create your user and tell WSL which username to use by default. See this answer for details on that.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.