Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apt-get command does not work on Ubuntu-On-Windows / Windows Subsystem for Linux [closed]

I just installed Ubuntu-On-Windows recently added on Windows 10 for peoples on the fast ring. However, when trying to install new applications using apt-get, the command seems to fail everytime. I'm getting this error:

Err http://security.ubuntu.com trusty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
Err http://archive.ubuntu.com trusty Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-updates Release.gpg
  Could not resolve 'archive.ubuntu.com'

I know this is a beta and has just been released, but is there a fix for that out yet?

like image 229
GammaOmega Avatar asked Apr 07 '16 03:04

GammaOmega


People also ask

Does apt work in WSL?

Package management on Ubuntu on WSL works the same as on desktop Ubuntu, using the apt package manager. apt will download and install packages from the Ubuntu archive.

How do I fix the Windows Subsystem for Linux optional component is not enabled?

Installation issues. The Windows Subsystem for Linux optional component is not enabled: Open Control Panel -> Programs and Features -> Turn Windows Feature on or off -> Check Windows Subsystem for Linux or using the PowerShell cmdlet mentioned at the beginning of this article.

How do I fix the apt-get command not found?

After installing the APT package, check the /usr/bin/ directory to ensure if it had properly installed. If the file is empty, then run the locate apt-get command again. If no result is shown, there is no alternative but to reinstall the operating system. This might fix the problem.

How do I install apt-get in Windows?

Download and installDownload the installer below and double-click install-windows-apt.exe to start the installer. Install APT to a folder you have default privileges for: We recommend installing this software into the default location (which is a folder within the user's home folder).


1 Answers

To fix the issue, I ran the following command:

apt-get update && apt-get upgrade

And now it works fine, even if I close and re-open the terminal.

like image 53
GammaOmega Avatar answered Oct 08 '22 18:10

GammaOmega