After downloading the Ubuntu app from the Windows store, I tried to run
gcc --version
and it showed command gcc not found
same was the case for g++
.
I tried to install using sudo apt install gcc
and it kept showing me errors like
Err:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 binutils-common amd64 2.30-21ubuntu1~18.04.1 404 Not Found
and at the end it gave me this
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
What I already tried:-
- I came across this Bash (on Windows 10) doesn't locate any package I did what was said there and then I ran the update command and then the
sudo apt install gcc
command. It did install gcc which I checked by usinggcc --version
. But then when I ran the 'sudo apt install g++` it gave me errors
The following packages have unmet dependencies:
g++ : Depends: g++-4.8 (>= 4.8.2-5~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
- My question was identified as a possible duplicate of Unable to correct problems, you have held broken packages , but it turns out it was of no help. When I ran the command
dpkg --get-selections | grep hold
to find out the list of the held packages I got nothing. I tried again usingsudo aptitude install g++
it gave this as an output.
The following actions will resolve these dependencies:
Remove the following packages:
1) bind9-host
2) cloud-init
3) dnsutils
4) initramfs-tools-core
5) landscape-common
6) libbind9-160
7) libcom-err2
8) libcurl4
9) libdns1100
10) libext2fs2
11) libirs160
12) libisccfg160
13) python3-cryptography
14) python3-oauthlib
15) python3-openssl
16) python3-service-identity
17) python3-twisted
18) ureadahead
Install the following packages:
19) e2fslibs [1.42.9-3ubuntu1.3 (trusty-updates)]
20) insserv [1.14.0-5ubuntu2 (trusty)]
21) knot-dnsutils [1.4.2-1 (trusty)]
22) libck-connector0 [0.4.5-3.1ubuntu2 (trusty)]
23) libcomerr2 [1.42.9-3ubuntu1.3 (trusty-updates)]
24) libcurl3 [7.35.0-1ubuntu2.20 (trusty-security, trusty-updates)]
25) libgcrypt11 [1.5.3-2ubuntu4.6 (trusty-security, trusty-updates)]
26) libgnutls26 [2.12.23-12ubuntu2.8 (trusty-security, trusty-updates)]
27) librtmp0 [2.4+20121230.gitdf6c518-1ubuntu0.1 (trusty-security, trusty-updates)]
28) module-init-tools [15-0ubuntu7 (trusty-security, trusty-updates)]
29) sysv-rc [2.88dsf-41ubuntu6.3 (trusty-updates)]
Keep the following packages at their current version:
30) g++ [Not Installed]
31) g++-4.8 [Not Installed]
32) libc-dev-bin [Not Installed]
33) libc6-dev [Not Installed]
34) libstdc++-4.8-dev [Not Installed]
Downgrade the following packages:
35) curl [7.58.0-2ubuntu3.6 (now) -> 7.35.0-1ubuntu2.20 (trusty-security, trusty-updates)]
36) e2fsprogs [1.44.1-1ubuntu1.1 (now) -> 1.42.9-3ubuntu1.3 (trusty-updates)]
37) git [1:2.17.1-1ubuntu0.4 (now) -> 1:1.9.1-1ubuntu0.10 (trusty-security, trusty-updates)]
38) git-man [1:2.17.1-1ubuntu0.4 (now) -> 1:1.9.1-1ubuntu0.10 (trusty-security, trusty-updates)]
39) initramfs-tools [0.130ubuntu3.7 (now) -> 0.103ubuntu4.11 (trusty-updates)]
40) initramfs-tools-bin [0.130ubuntu3.7 (now) -> 0.103ubuntu4.11 (trusty-updates)]
41) libcurl3-gnutls [7.58.0-2ubuntu3.6 (now) -> 7.35.0-1ubuntu2.20 (trusty-security, trusty-updates)
42) libgssapi-krb5-2 [1.16-2ubuntu0.1 (now) -> 1.12+dfsg-2ubuntu5.4 (trusty-security, trusty-updates
43) libk5crypto3 [1.16-2ubuntu0.1 (now) -> 1.12+dfsg-2ubuntu5.4 (trusty-security, trusty-updates)]
44) libkrb5-3 [1.16-2ubuntu0.1 (now) -> 1.12+dfsg-2ubuntu5.4 (trusty-security, trusty-updates)]
45) libkrb5support0 [1.16-2ubuntu0.1 (now) -> 1.12+dfsg-2ubuntu5.4 (trusty-security, trusty-updates)
46) libss2 [1.44.1-1ubuntu1.1 (now) -> 1.42.9-3ubuntu1.2 (trusty-security)]
47) manpages [4.15-1 (now) -> 3.54-1ubuntu1 (trusty)]
48) openssh-client [1:7.6p1-4ubuntu0.3 (now) -> 1:6.6p1-2ubuntu2.13 (trusty-security, trusty-updates
49) openssh-server [1:7.6p1-4ubuntu0.3 (now) -> 1:6.6p1-2ubuntu2.13 (trusty-security, trusty-updates
50) openssh-sftp-server [1:7.6p1-4ubuntu0.3 (now) -> 1:6.6p1-2ubuntu2.13 (trusty-security, trusty-up
Leave the following dependencies unresolved:
51) python3-incremental recommends python3-twisted
52) python3-jwt recommends python3-cryptography
53) ubuntu-standard recommends ureadahead
I pressed Y and then
E: The method driver /usr/lib/apt/methods/http could not be found.
E: The method driver /usr/lib/apt/methods/http could not be found.
E: Internal error: couldn't generate list of packages to download
- I started fresh by resetting the app and then ran the command
sudo apt update
and it showed this
Reading package lists... Done
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 4h 13min 23s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 4h 12min 44s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 4h 14min 2s). Updates for this repository will not be applied.
I would also like to mention that I am a beginner to this linux environment so if you can explain your answers a bit it would be really helpful
trusty
tobionic
that's not going to work (and may explain why it's looking forg++-4.8
whereas the current version forbionic
is 7.4.0) – steeldriver Aug 11 '19 at 11:09apt-transport-http
. I'm not sure if WSL supports it. – Mukesh Sai Kumar Aug 11 '19 at 11:26sudo apt update
- now (by changing your sources list to includetrusty
repositories) you have unfortunately dug yourself into a much deeper hole – steeldriver Aug 11 '19 at 11:44sudo apt install g++
gives the same error that I mentioned. Like thisErr:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 binutils-common amd64 2.30-21ubuntu1~18.04.1 404 Not Found
– Arnab_Sen Aug 11 '19 at 11:55