Score:-3

How do I install apt on Ubuntu?

cn flag

I'm trying to install Google authenticator on Ubuntu.

I tried sudo apt install libpam-google-authenticator which results in the error sudo: apt: command not found. Shouldn't apt already be installed on Ubuntu? I have tried several commands with apt. Beware I am very new to Linux.

When I use the command lsb_release -a this is the output:

-bash: lsb_release: command not found

I installed "Ubuntu 20.04 LTS" from the Microsoft Store.

When I use the command cat /etc/os-release this is the output:

NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
$: echo $PATH
/home/mkristiansen/.local/bin:/home/mkristiansen/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
Iván Araolaza avatar
br flag
Yes, it should. Which version of Ubuntu are you running? And could you please add some screenshots of the message?
us flag
Can you edit the question and post the output of the command `lsb_release -a`?
Nmath avatar
ng flag
`apt` is always installed on Ubuntu Server, Ubuntu Desktop, and every official flavour of Ubuntu. Can you tell us how it was removed?
Iván Araolaza avatar
br flag
Are you running Ubuntu in WSL?
user1560375 avatar
cn flag
I have only installed ubuntu from microsoft store on my windows 10 computer. I have not installed WSL. Thank you
marosg avatar
vn flag
Could you update with an output of `cat /etc/os-release` ?
marosg avatar
vn flag
Also, please show an output of `echo $PATH`
user535733 avatar
cn flag
Your output clearly shows that you are running CentOS, not Ubuntu. CentOS does not use apt.
Nmath avatar
ng flag
1) Ubuntu from the Microsoft Store in Windows 10 **is** WSL. If you installed any Linux distro on Windows from the Microsoft Store, you are using WSL. 2) You aren't running Ubuntu, you are running CentOS which does not use `apt` as a package manager, it uses `yum` 3) CentOS is [off-topic](https://askubuntu.com/help/on-topic). You can ask about CentOS on [Unix&Linux](https://unix.stackexchange.com).
user1560375 avatar
cn flag
Why is it running centOS when the program I installed is called ubuntu? And how do I run ubuntu is there something else I need to install? Thank you all for taking your time and help.
Nmath avatar
ng flag
Somehow you installed CentOS. Perhaps you also installed Ubuntu, but when you entered those commands, you weren't using Ubuntu, you were using CentOS. CentOS is an entirely different Linux distribution and is not very similar to Ubuntu as it is in the "RedHat" family of Linux and Ubuntu is Debian-based.
user1560375 avatar
cn flag
Ok I see. Do you have a guide on how to install ubuntu properly?
cocomac avatar
cn flag
@user1560375 Yes. Open the Microsoft Store, click the search bar, and type "Ubuntu". Click on it, and press install. Here is [a link to Ubuntu](https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6?activetab=pivot:overviewtab) in the Store. Once you've downloaded it, just launch it (from the start menu), do the short setup, and then enjoy it!
NotTheDr01ds avatar
vn flag
@user1560375 If you are using the latest Windows 10 (21H2) or Windows 11 release, simply `wsl --install Ubuntu`. Cocomac's method works also (for all WSL and Windows releases).
user1560375 avatar
cn flag
I just wanted to add that I logged in to my schools server with ssh username@server-adress and that might be why it was running on centOS, is it that my schools server somehow runs on centOS? When Im logged in on my PC on ubuntu and write command "cat /etc/os-release" it says ubuntu. So only when I ssh to my schools server and write command "cat /etc/os-release" it says centOS?
Score:2
br flag

You are running CentOS, not Ubuntu. CentOS uses yum as package manager. If, for any reason, you still want to use apt on what you're running, check this out.

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.