C
C#15mo ago
whgrs1692

❔ ✅ Installing the .NET SDK on Ubuntu 23.04

Does anyone here have experience with installing .NET 7 on Ubuntu?
124 Replies
whgrs1692
whgrs1692OP15mo ago
I followed the docs on MS but they are all over the place and nothing works.
whgrs1692
whgrs1692OP15mo ago
Yes The install doesnt work - when I run dotnet --info after the install, its says no SDK found I have been on it for 3 days - I have tried installs with apt and snap - neither work. I have reinstalled vscode a few times but that too cannot find the SDK. Logged to github but no one is picking it up
SinFluxx
SinFluxx15mo ago
When you run sudo apt install again what's the output, does it say it installed something or that there was 1 not upgraded or whatever
whgrs1692
whgrs1692OP15mo ago
Yes, it says the SDK is installed - but dotnet --info says its not and dotnet --list-sdks returns a blank line And the PATH variable does not get added automatically to the ~/.bashrc file And when I add the PATH manually it still doesnt work
SinFluxx
SinFluxx15mo ago
you didn't install the runtime first and then the sdk after from different providers did you?
whgrs1692
whgrs1692OP15mo ago
No, the runtime should install automatically ( which it does ) but the SDK does not install so when I run dotnet --list-runtimes, the runtime shows
reflectronic
reflectronic15mo ago
never try installing the runtime or SDK multiple different ways. it will never work. all but one installation is ignored this is practically guaranteed to be your problem
whgrs1692
whgrs1692OP15mo ago
I learnt that on day one. Then I set about removing all traces of .NET and started again. so whats the solution? The issue with multiple feeds was apparently fixed
reflectronic
reflectronic15mo ago
i mean. you need to nuke everything .NET related on your computer and try again. if the instructions in the article don’t work then you need to figure out why they don’t work rather than try installing it a different way
whgrs1692
whgrs1692OP15mo ago
I have nuked everything - there is not a single file or folder on the system with dotnet in the name I must have gone through about 40 iterations of cleaning and reinstalling I have decided the snap package manager does not work - so I have been trying only the apt one
reflectronic
reflectronic15mo ago
yes, the snap is sort of broken unfortunately
whgrs1692
whgrs1692OP15mo ago
But it looks like thats broken too
reflectronic
reflectronic15mo ago
did you add the microsoft feed
whgrs1692
whgrs1692OP15mo ago
I am staring down a full reinstall of Ubuntu which I would like to avoid Yes, went down that route many many times
reflectronic
reflectronic15mo ago
remove it
whgrs1692
whgrs1692OP15mo ago
Yes, I have removed it The only thing I havent tried is downloading the binaries and installing manually
reflectronic
reflectronic15mo ago
do not do that either
whgrs1692
whgrs1692OP15mo ago
Its crazy - why does MS not deal with this
reflectronic
reflectronic15mo ago
because it works fine
whgrs1692
whgrs1692OP15mo ago
It absolutely does not - check github This issue is exactly the same as with 6.0 and Ubuntu 22.04 as well as 20.04
reflectronic
reflectronic15mo ago
do you have DOTNET_ROOT set in your environment variables
whgrs1692
whgrs1692OP15mo ago
Yes. I tried a number of differnt PATH statements inclusing DOTNET_ROOT
reflectronic
reflectronic15mo ago
delete that
whgrs1692
whgrs1692OP15mo ago
I have run every imaginable configuration of PATH statement on BOTH snap and apt installs. Nothing works
reflectronic
reflectronic15mo ago
trying every combination is not the solution you need to figure out why the recommended solution does not work
whgrs1692
whgrs1692OP15mo ago
Yes, I am testament to that I have spent 2 days trawling hundreds of posts - Its MS job to figure that out - not mine. I dont have heavy skills in Linux scripting either.
reflectronic
reflectronic15mo ago
make sure absolutely every dotnet environment variable, path, file is deleted and just install dotnet-sdk-7.0 from the Ubuntu repos. if it’s broken we will figure out why it is broken
whgrs1692
whgrs1692OP15mo ago
The current state of the machine is clean - no mods to the ~/.bashrc and no dotnet files or folders No point in following the docs - installing the dotnet-sdk-7.0 does not work sudo apt-get install -y dotnet-sdk-7.0 does not work I have also done resource ~/.bashrc to make sure the current state of the bashrc file is used
reflectronic
reflectronic15mo ago
what about it does not work
whgrs1692
whgrs1692OP15mo ago
its all in my third comment Do you have actual experience with Ubuntu and the .NET 7.0 SDK ? And running up a container is not the same as having a full Ubuntu install.
reflectronic
reflectronic15mo ago
i just did this on my install of Ubuntu.
reflectronic@JOHNS-MACBOOK-PRO:~$ sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-7.0
reflectronic@JOHNS-MACBOOK-PRO:~$ dotnet --list-sdks
7.0.111 [/usr/lib/dotnet/sdk]
reflectronic@JOHNS-MACBOOK-PRO:~$ dotnet --list-runtimes
Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.8 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
reflectronic@JOHNS-MACBOOK-PRO:~$ sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-7.0
reflectronic@JOHNS-MACBOOK-PRO:~$ dotnet --list-sdks
7.0.111 [/usr/lib/dotnet/sdk]
reflectronic@JOHNS-MACBOOK-PRO:~$ dotnet --list-runtimes
Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.8 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
as you can see the SDKs and the runtimes both work perfectly. the fact that it does not work for you means your machine's configuration is screwed up somehow. we can either figure out what's wrong or you can sit here and complain about how microsoft should fix your computer for you i much prefer the first option
whgrs1692
whgrs1692OP15mo ago
Can you run dotnet --info ? Does it say a SDK was found? I am not running a macbook That command does not work on my machine although it says it does And what version of Ubuntu are you running? - this command worked perfectly for me on 22.04
reflectronic
reflectronic15mo ago
i'm on 22.04. are you on a different version?
reflectronic@JOHNS-MACBOOK-PRO:~/work$ dotnet --info
.NET SDK:
Version: 7.0.111
Commit: 06c8b346e4

Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/7.0.111/

Host:
Version: 7.0.11
Architecture: x64
Commit: ecb34f85ec

.NET SDKs installed:
7.0.111 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/lib/dotnet]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
reflectronic@JOHNS-MACBOOK-PRO:~/work$ dotnet --info
.NET SDK:
Version: 7.0.111
Commit: 06c8b346e4

Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/7.0.111/

Host:
Version: 7.0.11
Architecture: x64
Commit: ecb34f85ec

.NET SDKs installed:
7.0.111 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/lib/dotnet]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
whgrs1692
whgrs1692OP15mo ago
Yes, 23.04 Yes, it works for you. It worked for me too on 22.04 can you check if the PATH was updated/added in your bash?
reflectronic
reflectronic15mo ago
reflectronic@JOHNS-MACBOOK-PRO:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/reflectronic/.dotnet/tools
reflectronic@JOHNS-MACBOOK-PRO:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/reflectronic/.dotnet/tools
reflectronic@JOHNS-MACBOOK-PRO:~/work$ which dotnet
/usr/bin/dotnet
reflectronic@JOHNS-MACBOOK-PRO:~/work$ echo $DOTNET_ROOT
/usr/lib/dotnet
reflectronic@JOHNS-MACBOOK-PRO:~/work$ which dotnet
/usr/bin/dotnet
reflectronic@JOHNS-MACBOOK-PRO:~/work$ echo $DOTNET_ROOT
/usr/lib/dotnet
whgrs1692
whgrs1692OP15mo ago
Looks fine -
reflectronic
reflectronic15mo ago
so, after you install the package, when you do dotnet --list-sdks, it says you have none
whgrs1692
whgrs1692OP15mo ago
it just returns a blank line dotnet --info says there is no SDKs found but it does find the runtime
reflectronic
reflectronic15mo ago
what does ls /usr/lib/dotnet/sdk give you
whgrs1692
whgrs1692OP15mo ago
ls: cannot access '/usr/lib/dotnet/sdk': No such file or directory The machine is clean echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/greg/.dotnet/tools whereis dotnet dotnet: /etc/dotnet
reflectronic
reflectronic15mo ago
if you still have the dotnet program then the machine isn't clean
whgrs1692
whgrs1692OP15mo ago
echo $DOTNET_ROOT returns a blank line hmmm - i didnt clean .dotnet folders
reflectronic
reflectronic15mo ago
what does ls /etc/dotnet give you
whgrs1692
whgrs1692OP15mo ago
install_location install_location_x64
reflectronic
reflectronic15mo ago
you definitely need to nuke that folder too
whgrs1692
whgrs1692OP15mo ago
ok rm: cannot remove 'install_location': No such file or directory
reflectronic
reflectronic15mo ago
just sudo rm -rf /etc/dotnet
whgrs1692
whgrs1692OP15mo ago
ls /etc/dotnet ls: cannot access '/etc/dotnet': No such file or directory
reflectronic
reflectronic15mo ago
i guess you already deleted it then
whgrs1692
whgrs1692OP15mo ago
yes
reflectronic
reflectronic15mo ago
now whereis dotnet is empty right? if you do dotnet then it'll tell you dotnet is not found, right?
whgrs1692
whgrs1692OP15mo ago
whereis dotnet dotnet: dotnet Command 'dotnet' not found, but can be installed with: sudo snap install dotnet-sdk # version 7.0.401, or sudo apt install dotnet-host # version 6.0.122-0ubuntu1~23.04.1 sudo apt install dotnet-host-7.0 # version 7.0.111-0ubuntu1~23.04.1 See 'snap info dotnet-sdk' for additional versions.
reflectronic
reflectronic15mo ago
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
sudo apt update
sudo apt install dotnet7
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
sudo apt update
sudo apt install dotnet7
whgrs1692
whgrs1692OP15mo ago
dotnet --info Host: Version: 7.0.11 Architecture: x64 Commit: ecb34f85ec .NET SDKs installed: No SDKs were found. .NET runtimes installed: Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
dotnet command - .NET CLI
Learn about the dotnet command (the generic driver for the .NET CLI) and its usage.
Microsoft
.NET Downloads (Linux, macOS, and Windows)
Official .NET downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.
reflectronic
reflectronic15mo ago
seems like it's working
whgrs1692
whgrs1692OP15mo ago
No SDKs found
reflectronic
reflectronic15mo ago
oh i see try echo $DOTNET_ROOT
whgrs1692
whgrs1692OP15mo ago
blank like same with dotnet --list-sdks
reflectronic
reflectronic15mo ago
can you reopen your terminal and try again
whgrs1692
whgrs1692OP15mo ago
dotnet --list-runtimes Microsoft.AspNetCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.11 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] reopened terminal and cleaned and installed - same So , the runtime is installed but not the SDKs
reflectronic
reflectronic15mo ago
okay. what is ls /usr/lib/dotnet/sdk
whgrs1692
whgrs1692OP15mo ago
ls: cannot access '/usr/lib/dotnet/sdk': No such file or directory
reflectronic
reflectronic15mo ago
ls /usr/lib/dotnet
whgrs1692
whgrs1692OP15mo ago
ls /usr/lib/dotnet dotnet host LICENSE.txt packs shared ThirdPartyNotices.txt
reflectronic
reflectronic15mo ago
apt list --installed dotnet*
whgrs1692
whgrs1692OP15mo ago
apt list --installed dotnet* Listing... Done
reflectronic
reflectronic15mo ago
so it's empty
whgrs1692
whgrs1692OP15mo ago
yep
reflectronic
reflectronic15mo ago
can you send the output that you get when you run sudo apt install dotnet7
whgrs1692
whgrs1692OP15mo ago
ok
whgrs1692
whgrs1692OP15mo ago
greg@greg-ThinkPad-E520:~$ sudo apt install dotnet7 Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: aspnetcore-runtime-7.0 aspnetcore-targeting-pack-7.0 dotnet-sdk-7.0 The following NEW packages will be installed aspnetcore-runtime-7.0 aspnetcore-targeting-pack-7.0 dotnet-sdk-7.0 dotnet7 0 to upgrade, 4 to newly install, 0 to remove and 18 not to upgrade. Need to get 28.4 kB/117 MB of archives. After this operation, 448 MB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://fr.archive.ubuntu.com/ubuntu lunar-updates/universe amd64 dotnet7 amd64 7.0.111-0ubuntu1~23.04.1 [28.4 kB] Fetched 28.4 kB in 0s (255 kB/s)
Selecting previously unselected package aspnetcore-targeting-pack-7.0. (Reading database ... 280264 files and directories currently installed.) Preparing to unpack .../aspnetcore-targeting-pack-7.0_7.0.111-0ubuntu1~23.04.1_amd64.deb ... Unpacking aspnetcore-targeting-pack-7.0 (7.0.111-0ubuntu1~23.04.1) ... Selecting previously unselected package aspnetcore-runtime-7.0. Preparing to unpack .../aspnetcore-runtime-7.0_7.0.111-0ubuntu1~23.04.1_amd64.deb ... Unpacking aspnetcore-runtime-7.0 (7.0.111-0ubuntu1~23.04.1) ... Selecting previously unselected package dotnet-sdk-7.0. Preparing to unpack .../dotnet-sdk-7.0_7.0.401-1_amd64.deb ... Unpacking dotnet-sdk-7.0 (7.0.401-1) ... Selecting previously unselected package dotnet7. Preparing to unpack .../dotnet7_7.0.111-0ubuntu1~23.04.1_amd64.deb ... Unpacking dotnet7 (7.0.111-0ubuntu1~23.04.1) ... Setting up aspnetcore-targeting-pack-7.0 (7.0.111-0ubuntu1~23.04.1) ... Setting up aspnetcore-runtime-7.0 (7.0.111-0ubuntu1~23.04.1) ... Setting up dotnet-sdk-7.0 (7.0.401-1) ... Setting up dotnet7 (7.0.111-0ubuntu1~23.04.1) ... greg@greg-ThinkPad-E520:~$
reflectronic
reflectronic15mo ago
and now if you ls /usr/lib/dotnet
whgrs1692
whgrs1692OP15mo ago
ls /usr/lib/dotnet dotnet host LICENSE.txt packs shared ThirdPartyNotices.txt apt list --installed dotnet* Listing... Done are we done?
reflectronic
reflectronic15mo ago
how about dpkg-query --list dotnet* this is looking like an ubuntu issue and not a dotnet issue
whgrs1692
whgrs1692OP15mo ago
ok dpkg-query --list dotnet* dpkg-query: no packages found matching dotnet-install.sh
reflectronic
reflectronic15mo ago
try dpkg-query --list dotnet\* it is not supposed to expand to dotnet-install.sh
whgrs1692
whgrs1692OP15mo ago
dpkg-query --list dotnet* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=========================-========================-============-======================================================= un dotnet-apphost-pack-6.0 <none> <none> (no description available) ii dotnet-apphost-pack-7.0 7.0.111-0ubuntu1~23.04.1 amd64 Internal - targeting pack for Microsoft.NETCore.App 7.0 un dotnet-host <none> <none> (no description available) ii dotnet-host-7.0 7.0.111-0ubuntu1~23.04.1 amd64 dotNET host command line un dotnet-hostfxr-6.0 <none> <none> (no description available) ii dotnet-hostfxr-7.0 7.0.111-0ubuntu1~23.04.1 amd64 dotNET host resolver un dotnet-runtime-6.0 <none> <none> (no description available) ii dotnet-runtime-7.0 7.0.111-0ubuntu1~23.04.1 amd64 dotNET runtime ii dotnet-sdk-7.0 7.0.401-1 amd64 Microsoft .NET SDK 7.0.401 un dotnet-targeting-pack-6.0 <none> <none> (no description available) ii dotnet-targeting-pack-7.0 7.0.111-0ubuntu1~23.04.1 amd64 Internal - targeting pack for Microsoft.NETCore.App 7.0 un dotnet6 <none> <none> (no description available) ii dotnet7 7.0.111-0ubuntu1~23.04.1 amd64 dotNET CLI tools and runtime
reflectronic
reflectronic15mo ago
dpkg --listfiles dotnet-sdk-7.0
whgrs1692
whgrs1692OP15mo ago
whooaa - you want all that? Its big
reflectronic
reflectronic15mo ago
do they mostly start with /usr/lib/dotnet/sdk/7.0.111/
whgrs1692
whgrs1692OP15mo ago
here is a sample sorry - cant send - server is blocking it /usr/share/dotnet/sdk/7.0.401/Containers/containerize/Microsoft.Build.Framework.dll
reflectronic
reflectronic15mo ago
hmmmmmmm
whgrs1692
whgrs1692OP15mo ago
/usr/share/dotnet/sdk/7.0.401/DotnetTools/dotnet-format/ru/Microsoft.CodeAnalysis.Features.resources.dll
reflectronic
reflectronic15mo ago
ls /usr/share/dotnet
whgrs1692
whgrs1692OP15mo ago
Can you test this inside a 23.04 container? ls /usr/share/dotnet sdk sdk-manifests templates
reflectronic
reflectronic15mo ago
if it really installed to /usr/share/dotnet instead of /usr/lib/dotnet this would explain the issue indeed, that seems to be the issue so, it's isntalling the SDK to a different place from the runtime now the question is, why
whgrs1692
whgrs1692OP15mo ago
ok so why does it work for you? Is this only on 23.04? or is it the package causing the issue
reflectronic
reflectronic15mo ago
ah. 7.0.401 i see the issue the SDK is coming from the micrisoft repos but the runtime is coming from the ubuntu repos
whgrs1692
whgrs1692OP15mo ago
aha
reflectronic
reflectronic15mo ago
the ubuntu repos onl have 7.0.1xx so that is for sure the issue
whgrs1692
whgrs1692OP15mo ago
they were supposed to fix this - there was a github issue that was closed on this
reflectronic
reflectronic15mo ago
try
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
sudo apt remove --purge dotnet*
sudo apt remove --purge aspnetcore*
just to remove everything dotnet related. make sure /usr/share/dotnet is gone once you do that can you run ls /etc/apt/sources.list.d/microsoft-prod.list
whgrs1692
whgrs1692OP15mo ago
ls /etc/apt/sources.list.d/microsoft-prod.list ls: cannot access '/etc/apt/sources.list.d/microsoft-prod.list': No such file or directory
reflectronic
reflectronic15mo ago
dpkg -l packages-microsoft-prod.deb
whgrs1692
whgrs1692OP15mo ago
dpkg -l packages-microsoft-prod.deb dpkg-query: no packages found matching packages-microsoft-prod.deb
reflectronic
reflectronic15mo ago
whereis microsoft?
whgrs1692
whgrs1692OP15mo ago
whereis microsoft microsoft:
reflectronic
reflectronic15mo ago
ls /etc/apt/preferences
whgrs1692
whgrs1692OP15mo ago
ls /etc/apt/preferences ls: cannot access '/etc/apt/preferences': No such file or directory
reflectronic
reflectronic15mo ago
apt-cache policy 'dotnet.*'
reflectronic
reflectronic15mo ago
cat /etc/apt/sources.list
whgrs1692
whgrs1692OP15mo ago
cat /etc/apt/sources.list deb cdrom:[Ubuntu 22.10 Kinetic Kudu - Release amd64 (20221020)]/ kinetic main restricted See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to newer versions of the distribution. deb http://fr.archive.ubuntu.com/ubuntu/ lunar main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic main restricted Major bug fix updates produced after the final release of the distribution. deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic-updates main restricted N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team. Also, please note that software in universe WILL NOT receive any review or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ lunar universe deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic universe deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates universe deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic-updates universe N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free licence. Please satisfy yourself as to your rights to use the software. Also, please note that software in multiverse WILL NOT receive any review or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ lunar multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic multiverse deb http://fr.archive.ubuntu.com/ubuntu/ lunar-updates multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ kinetic-updates multiverse N.B. software from this repository may not have been tested as extensively as that contained in the main release, although it includes
reflectronic
reflectronic15mo ago
hm, well, it seems like the microsoft repo really is gone... can you do sudo apt update and paste the output
whgrs1692
whgrs1692OP15mo ago
sudo apt update [sudo] password for greg: Hit:1 http://security.ubuntu.com/ubuntu lunar-security InRelease Hit:2 http://fr.archive.ubuntu.com/ubuntu lunar InRelease
Hit:3 http://fr.archive.ubuntu.com/ubuntu lunar-updates InRelease
Hit:4 http://fr.archive.ubuntu.com/ubuntu lunar-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/linuxgndu/sqlitebrowser/ubuntu lunar InRelease
Hit:6 https://linux.teamviewer.com/deb stable InRelease
Hit:7 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Hit:8 https://packages.microsoft.com/repos/microsoft-ubuntu-lunar-prod lunar InRelease
Hit:9 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu lunar InRelease Get:10 https://packages.microsoft.com/repos/edge stable InRelease [3,569 B] Get:11 https://packages.microsoft.com/repos/edge stable/main amd64 Packages [8,555 B] Fetched 12.1 kB in 2s (6,685 B/s)
Reading package lists... Done Building dependency tree... Done Reading state information... Done 18 packages can be upgraded. Run 'apt list --upgradable' to see them.
reflectronic
reflectronic15mo ago
well, i guess it's still there somewhere
whgrs1692
whgrs1692OP15mo ago
you are now way above my paygrade
reflectronic
reflectronic15mo ago
ls /etc/apt/sources.list.d? maybe it's called something else
whgrs1692
whgrs1692OP15mo ago
s /etc/apt/sources.list.d azure-cli.list linuxgndu-ubuntu-sqlitebrowser-lunar.list microsoft-edge.list.distUpgrade ubuntu-toolchain-r-ubuntu-test-lunar.list dotnetdev.list microsoft-edge.list teamviewer.list
reflectronic
reflectronic15mo ago
hm, well, can you cat /etc/apt/sources.list.d/dotnetdev.list that seems like it might be it
whgrs1692
whgrs1692OP15mo ago
cat /etc/apt/sources.list.d/dotnetdev.list deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-lunar-prod lunar main
reflectronic
reflectronic15mo ago
delete that file then do sudo apt update again make sure https://packages.microsoft.com/repos/microsoft-ubuntu-lunar-prod is not one of the sources it lists when you do that
whgrs1692
whgrs1692OP15mo ago
sudo apt update Hit:1 http://fr.archive.ubuntu.com/ubuntu lunar InRelease Hit:2 http://fr.archive.ubuntu.com/ubuntu lunar-updates InRelease
Hit:3 https://linux.teamviewer.com/deb stable InRelease
Hit:4 http://fr.archive.ubuntu.com/ubuntu lunar-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/linuxgndu/sqlitebrowser/ubuntu lunar InRelease
Hit:6 http://security.ubuntu.com/ubuntu lunar-security InRelease
Hit:7 https://packages.microsoft.com/repos/azure-cli jammy InRelease
Hit:8 https://packages.microsoft.com/repos/edge stable InRelease
Hit:9 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu lunar InRelease Reading package lists... Done
Building dependency tree... Done Reading state information... Done 18 packages can be upgraded. Run 'apt list --upgradable' to see them.
reflectronic
reflectronic15mo ago
okay. now you can try sudo apt install dotnet7
whgrs1692
whgrs1692OP15mo ago
wooohooo you did it! no idea how you did it but you did thanks - summary?
reflectronic
reflectronic15mo ago
i mean, it's the same issue as most other people are having--the .NET SDK was coming from the microsoft repos, but the runtime was coming from the Ubuntu repos, and the two do not mix because they install to different folders https://learn.microsoft.com/en-Us/dotnet/core/install/linux-package-mixup?pivots=os-linux-other#whats-going-on for you it seemed to have installed some packages from Ubuntu and some from Microsoft. i do not know why exactly it chose to do this, but it shouldn't be able to in the first place
whgrs1692
whgrs1692OP15mo ago
OK - I respect your tenacity and help
reflectronic
reflectronic15mo ago
anyway, just deleting the microsoft repo and reinstaling everything makes it work. in the future, if you need the microsoft repos for some other software--maybe you want PowerShell or SQL Server--you will need to make sure it does not start pulling dotnet from there
whgrs1692
whgrs1692OP15mo ago
will do - Thanks again quick question - do I need to manually update the PATH?
reflectronic
reflectronic15mo ago
no dotnet is put into /usr/bin which is installed into the PATH already
whgrs1692
whgrs1692OP15mo ago
ok 👍 If you were in France, you would be getting a special bottle of wine!
reflectronic
reflectronic15mo ago
i'm glad i could help!
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server