Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"sudo apt install ..." does not work #758

Closed
CeciAc opened this issue Jun 17, 2020 · 11 comments
Closed

"sudo apt install ..." does not work #758

CeciAc opened this issue Jun 17, 2020 · 11 comments

Comments

@CeciAc
Copy link

CeciAc commented Jun 17, 2020

I moved this from here: https://github.com/MicrosoftDocs/WSL.de-DE/issues/10

@Oberurseler commented 14 days ago
I installed WSL2 and Ubuntu 18 (under Win10 2004) according to your indications. It works, however I cannot install any of the software I need. The "apt install" ends always wit an error. For example:_

apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)**

or anothe example:

sudo apt install gnuplot-x11
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gnuplot-x11

I may continue with other examples, like "gfortran" ...

Unfortunately, in this state WSL is not useful for me.
Dokumentdetails

⚠ Bearbeiten Sie diesen Abschnitt nicht. Er ist für die Verknüpfung von docs.microsoft.com zum GitHub-Artikel erforderlich.

  • ID: b7a1833a-3461-2d9e-bb1e-de5d0ee3fe33
  • Version Independent ID: bd4b2627-60c7-1bfe-7831-1dbde906e287
  • Content: Installieren des Windows-Subsystems für Linux (WSL) unter Windows 10
  • Content Source: WSL/install-win10.md
  • Product: dev-environment
  • Technology: windows-subsystem-for-linux
  • GitHub Login: @craigloewen-msft
  • Microsoft Alias: crloewen

@craigloewen-msft commented 14 days ago

Can you please try running sudo apt-get update instead? The first error indicates that you don't have sufficient permissions, and the second error could be caused because the apt package repositories haven't been updated.


@Oberurseler commented 14 days ago

Inded, this version of the command worked and I could install gfortran and gnuplot-nox, but not gnuplot-x11.
However, I am confronted with new problems. I am not able yet to get any X display (I must set the DISPLAY !?), therefore I could get only jpeg or postscript outputs.
and the fortran compiler does not work either:

$ f95 asinh.f95
asinh.f95:2:7:
    use slatec_module
       1
Fatal Error: Can't open module file ‘slatec_module.mod’ for reading at (1): No such file or directory

I tried to install xterm:

$ sudo apt-get install xterm
Reading package lists... Done
Building dependency tree
Reading state information... Done
xterm is already the newest version (330-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.

also it seems to be installed, but it does not work. Funny, but under WSL1 the xterm command worked.


@Oberurseler commented 14 days ago

I installed now gnuplot-qt that works with x11, but needs setting of DISPLAY .
I tried to set the DISPLAY, but it did not work:

$ export DISPLAY=localhost:0.0
$ xterm
xterm: Xt error: Can't open display: localhost:0.0
$
What now?

@Oberurseler
Copy link

I do not really understand the meaning of this last move. Fact is, that the DISPLAY does not work and gfortran misses some of the libraries. Therefore the discussion has to be shown under another title, not related to "sudo apt install ...". However I do not realize what happened actually.

@Oberurseler
Copy link

Perhaps it was moved to the english page? That' s all? I suggest also the change of the title.

@craigloewen-msft
Copy link
Collaborator

@Oberurseler for your DISPLAY issues, WSL 2 works slightly different than WSL 1 right now with regards to accessing network resources on the Windows host. You'll need to specify an IP address, as well you'll need to make sure your X server has access control disabled.

This blog post has a great summary of the different steps for running Cypress which should help you set up!

@Oberurseler
Copy link

Thanks! I will follow the indicated blog. With the network I have no problems. I can access my institute computer without any problem by ping, ssh, scp . The only problem is having DISPLAY on the windows screen.

@Oberurseler
Copy link

Of course remains still a problem with gfortran I already described.

@Oberurseler
Copy link

I am progressing slowly, but still unable to use DISPLAY. I included the line defining the DISPLAY by the IP address in the .bashrc and it seems to work:

$ echo $DISPLAY
172.21.64.1:0.0
$

however that is not enough.

$ xterm
xterm: Xt error: Can't open display: 172.21.64.1:0.0
$

No hint why !
There is a long exposition of steps to follow in the aforementioned blog, but I do not see yet if all that is really needed. I must read it more carefully.

@Oberurseler
Copy link

Thank You very much! I succeeded to run my GUIs with the help of VcXsrv. Actually it was very clear explained in the blog you indicated.
The only problem remains with the "gfortran":

$ f95 asinh.f95
asinh.f95:2:7:

    use slatec_module
       1
Fatal Error: Can't open module file ‘slatec_module.mod’ for reading at (1): No such file or directory
compilation terminated.
$

How to get and install this module ?

@Oberurseler
Copy link

I convinced myself that the installed gfortran still works with f90 programs, but not with f95. On the other hand in a true Ubuntu gfortran works also with f95 programs. It would be nice to have the same possibility !

@Oberurseler
Copy link

Perhaps it makes sense to close this issue on GUIs with the succesfull reference of craigloewen-msft to

https://nickymeuleman.netlify.app/blog/gui-on-wsl2-cypress

and to start a separate issue on gfortran with f95.

@Oberurseler
Copy link

I have tried to install g95 with the binary g95-x86-linux.tgz according to the instructions but it does not work. The executable link g95 in /usr/bin is not executed as "not found"!
One can see the value of the PATH, one can add to it, but I found nowhere its proper definition. There is no .bash_profile

@craigloewen-msft
Copy link
Collaborator

I think we are now talking about a new issue as you've identified. I'll close this issue out as it isn't docs related, if you still are running into a technical issue with WSL could you please open a new issue on the WSL Github Repo as we track only docs issues here. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants