website icon indicating copy to clipboard operation
website copied to clipboard

stop-using-apt/

Open utterances-bot opened this issue 3 years ago • 50 comments

Stop Using APT

Having Fun with Technology

https://christitus.com/stop-using-apt/

utterances-bot avatar Jul 20 '22 14:07 utterances-bot

The sudo apt alias doesn't work by itself.

The alias works, but not when using sudo. I had to add the following to my .bashrc as well.

alias sudo='sudo '

Thanks for recommending this awesome utility. It is an eyecandy and it does it's job.

cris1 avatar Jul 20 '22 14:07 cris1

This is awesome, Chris; great find! Thanks for sharing!

DonnyBahama avatar Jul 20 '22 17:07 DonnyBahama

always great content, been on Windows for ahem number of years, but starting to dip my toes into Linux as I build out some self-hosted stuff. Thanks Chris.

side note - like chris1 above I also needed to add the "alias sudo='sudo ' to the .bashrc file to get nala to work properly using the apt alias

callisto012 avatar Jul 20 '22 17:07 callisto012

Just a little head's up, there is a known issue when using the legacy nala install on Ubuntu 2.0.04 LTS (and lower I'm guessing): the fetch command throws an error. The workaround offered (https://gitlab.com/volian/nala/-/issues/92) is running the command sudo nala fetch --country followed by your country code in captital letters. I didn't get the issue on my Raspberry Pi, which also had to get the legacy install of nala.

SvenMazet avatar Jul 20 '22 18:07 SvenMazet

The sudo apt alias doesn't work by itself.

The alias works, but not when using sudo. I had to add the following to my .bashrc as well.

alias sudo='sudo '

Thanks for recommending this awesome utility. It is an eyecandy and it does it's job.

always great content, been on Windows for ahem number of years, but starting to dip my toes into Linux as I build out some self-hosted stuff. Thanks Chris.

side note - like chris1 above I also needed to add the "alias sudo='sudo ' to the .bashrc file to get nala to work properly using the apt alias

I'll add the alias to the root as well. /root/.bashrc should do the trick.

ChrisTitusTech avatar Jul 20 '22 18:07 ChrisTitusTech

Tried this on Zorin OS 16 Pro and get error saying 'Zorin focal is unsupported'.

TheDarkStarUK avatar Jul 20 '22 18:07 TheDarkStarUK

Works on POP OS! :P (sudo alias needed! )

tacogerbil avatar Jul 20 '22 22:07 tacogerbil

Had to use nala-legacy for some older ubuntu systems i have and i was running fetch and ran into some errors. Seems to be running into an error in the "asyncio.run" portion but it also mentions python3 errors at certain lines in those files and then it errors out again when trying to handle the exception and again its in the python3 files any help would be appreciated as I'm new(ish) to linux. still seems like a better "pm front-end" than apt so I'd like to use it if possible.

C-Keenan avatar Jul 21 '22 00:07 C-Keenan

just saw the fetch error comment someone else left lol

C-Keenan avatar Jul 21 '22 00:07 C-Keenan

One thing to be careful of is that nala upgrade is not completely synonymous with apt upgrade, nala by default goes ahead with an auto-remove and this sort of screwed up a bunch of things on my system where packages weren't "directly" installed but were for sure still needed on my system for certain functionality.

timnolte avatar Jul 21 '22 00:07 timnolte

I have Linux Mint 20.3, which uses Ubuntu 20.04.5. I followed your install instructions and when I entered this command

sudo apt update && sudo apt install nala-legacy

I got this error message

E: The repository 'http://dl.google.com/linux/earth/deb stable InRelease' is not signed.

The man page for apt-secure tells me

    You can force all APT clients to raise only warnings by setting the configuration option Acquire::AllowInsecureRepositories to true. Individual
   repositories can also be allowed to be insecure via the sources.list(5) option allow-insecure=yes. Note that insecure repositories are strongly
   discouraged and all options to force apt to continue supporting them will eventually be removed. Users also have the Trusted option available to
   disable even the warnings, but be sure to understand the implications as detailed in sources.list(5).

What would you suggest? Thanks for your patience.

Twixtfanatic avatar Jul 21 '22 03:07 Twixtfanatic

I cannot add the repo to my WSL 2 instance. This is what I get after step 2:

❯ echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list
wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null
deb http://deb.volian.org/volian/ scar main
❯ sudo apt update && sudo apt install nala
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:2 http://deb.volian.org/volian scar InRelease [15.5 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Err:2 http://deb.volian.org/volian scar InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A87015F3DA22D980
Reading package lists... Done
W: GPG error: http://deb.volian.org/volian scar InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A87015F3DA22D980
E: The repository 'http://deb.volian.org/volian scar InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

zamostny avatar Jul 21 '22 10:07 zamostny

I added the alias to my /root/.bashrc and it's still not working with sudo. What am I missing? Thanks.

silverskymedia avatar Jul 21 '22 14:07 silverskymedia

Great tool so far. Thank you for this post.

For zamostny

The issue on the first command might be that the wget didn't actually work. I had a similar issue now. I have also had issues with two sudo commands that are pasted into a console and tries to execute as one line.

Run the two lines separately and remove the redirect to dev null to check that the actual error is not hidden away.

echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list

wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg

LeonvanHeerden avatar Jul 21 '22 14:07 LeonvanHeerden

After install nala, I used to upgrade packages. (Ubuntu22.04), and when I run "nala clean", the command went to error. So, seems nala is not so stable as the apt-get for now.

goldyard avatar Jul 21 '22 15:07 goldyard

Just updated to include apt conversion in both sudo and non-sudo settings.

ChrisTitusTech avatar Jul 21 '22 17:07 ChrisTitusTech

Just updated to include apt conversion in both sudo and non-sudo settings.

If you take the ">/dev/null" off, the "tee" will make the key display on the console. But if you were having an issue, if you l display the error on the screen.

LeonvanHeerden avatar Jul 21 '22 21:07 LeonvanHeerden

Thanks, it's very useful

franciscocastro54 avatar Jul 22 '22 03:07 franciscocastro54

Hope it supports Arch Linux's AUR helper.

olivertzeng avatar Jul 22 '22 07:07 olivertzeng

Here's how I got mine working, it's simple really..

Install

Add the required packages

echo "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list
echo "deb-src http://deb.volian.org/volian/ scar main" | sudo tee -a /etc/apt/sources.list.d/volian-archive-scar-unstable.list

Get the required keys

wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null

Install Nala

sudo apt update && sudo apt install nala

Replacement

For the .bashrc or .zshrc part, all you really need is this part and you will not need to add the extra alias to sudo..

sudo() {
  if [ "$1" = "apt" ]; then
    shift
    command sudo nala "$@"
  else
    command sudo "$@"
  fi
}

aphive avatar Jul 24 '22 16:07 aphive

@Twixtfanatic, your error has nothing to do with Nala, but your answer is only an internet search away:

https://www.google.com/search?q=The%20repository%20%27http%3A//dl.google.com/linux/earth/deb%20stable%20InRelease%27%20is%20not%20signed.

aphive avatar Jul 24 '22 16:07 aphive

nala upgrade
Traceback (most recent call last): File "/build/nala-legacy-jxjPNq/nala-legacy-0.10.0/nala-cli.py", line 30, in File "/build/nala-legacy-jxjPNq/nala-legacy-0.10.0/nala/init.py", line 37, in ModuleNotFoundError: No module named 'apt_pkg

subnerf avatar Jul 25 '22 23:07 subnerf

Looks similar to dnf so seems interesting, but fails to install on Ubuntu 22.04.4 LTS (server)

The following packages have unmet dependencies:
 nala : Depends: python3-anyio but it is not installable
        Depends: python3-httpx but it is not installable
        Depends: python3-rich but it is not installable
        Depends: python3-tomli but it is not installable
        Depends: python3-typer but it is not installable
        Recommends: python3-socksio but it is not installable

ThomasDalla avatar Jul 26 '22 21:07 ThomasDalla

Please don't try to replace the whole app just because of missing features. Add the features to the existing app.

kresike avatar Jul 26 '22 22:07 kresike

Getting the same issue listed just above by ThomasDalla. Running Linux Mint. From some google searches, does this just mean that the repositories that these live in aren't setup?

The following packages have unmet dependencies: nala : Depends: python3-anyio but it is not installable Depends: python3-httpx but it is not installable Depends: python3-rich but it is not installable Depends: python3-tomli but it is not installable Depends: python3-typer but it is not installable Recommends: python3-socksio but it is not installable E: Unable to correct problems, you have held broken packages.

shoafer0 avatar Jul 27 '22 13:07 shoafer0

Your best was 193 ms and on mine the best was 15 ms. Why is yours so slow? Maybe like a comment said on here have to do a county code?

Thank you.

This is better then apt now got to wait for some updates to use it.

RaymondDay61 avatar Jul 29 '22 07:07 RaymondDay61

silverskymedia said "I added the alias to my /root/.bashrc and it's still not working with sudo. What am I missing? Thanks."

Just reboot will fix it. Or I guess if some command to restart bash.

RaymondDay61 avatar Jul 29 '22 07:07 RaymondDay61

silverskymedia said "I added the alias to my /root/.bashrc and it's still not working with sudo. What am I missing? Thanks."

Just reboot will fix it. Or I guess if some command to restart bash.

Just switch to root with su command then do source /root/.bashrc

No need to restart or reboot... this isn't windows hehe.

ChrisTitusTech avatar Jul 29 '22 15:07 ChrisTitusTech

I have the same issue as ThomasDalla and shoafer0 on Debian Bullseye. The packages python3-typer and python3-tomli can't be located in my case, and the only result on the internet if you Google this in quotes is this thread right here.

ulaanbaatarhoteltours avatar Jul 30 '22 12:07 ulaanbaatarhoteltours

I have the same issue as ThomasDalla and shoafer0 on Debian Bullseye. The packages python3-typer and python3-tomli can't be located in my case, and the only result on the internet if you Google this in quotes is this thread right here.

You need to make sure you have Bullseye Backports repo added and enabled to install those packages.

timnolte avatar Jul 30 '22 17:07 timnolte