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

stop-using-apt/ #16

Open
utterances-bot opened this issue Jul 20, 2022 · 44 comments
Open

stop-using-apt/ #16

utterances-bot opened this issue Jul 20, 2022 · 44 comments

Comments

@utterances-bot
Copy link

Stop Using APT

Having Fun with Technology

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

Copy link

cris1 commented Jul 20, 2022

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.

Copy link

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

Copy link

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

Copy link

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.

@ChrisTitusTech
Copy link
Owner

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.

Copy link

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

Copy link

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

Copy link

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.

Copy link

just saw the fetch error comment someone else left lol

Copy link

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.

Copy link

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.

Copy link

zamostny commented Jul 21, 2022

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.

Copy link

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

Copy link

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

Copy link

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.

Copy link
Owner

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

@LeonvanHeerden
Copy link

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.

Copy link

Thanks, it's very useful

Copy link

Hope it supports Arch Linux's AUR helper.

Copy link

aphive commented Jul 24, 2022

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
}

Copy link

aphive commented Jul 24, 2022

@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.

Copy link

subnerf commented Jul 25, 2022

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

Copy link

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

Copy link

kresike commented Jul 26, 2022

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

Copy link

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.

Copy link

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.

Copy link

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.

@ChrisTitusTech
Copy link
Owner

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.

@ulaanbaatarhoteltours
Copy link

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.

@timnolte
Copy link

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
Copy link

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.

Here is an article from a quick Google search on how to make sure you have the backports enabled.

https://www.how2shout.com/linux/how-to-install-and-use-backports-in-debian-11-bullseye/#Steps_to_Add_or_Install_Backports_on_Debian_11_Bullseye

@ulaanbaatarhoteltours
Copy link

ulaanbaatarhoteltours commented Jul 30, 2022 via email

Copy link

I got this working on Windows 10 and WSL2 Ubuntu 22.04 and Pop_OS! 22.04. I am going to probably roll Debian firmware + nala + material shell on my Pop_OS! laptop. I think this is fantastic!

Copy link

subnerf commented Aug 4, 2022

this happined when i upgrade Error: https://mirror.misakamikoto.network/ubuntu-ports jammy/multiverse amd64 Packages
404 Not Found [IP: 119.201.28.53 443]

Copy link

May I ask that you update the add repository to:

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

It's the EXACT SAME code, but for the ones, like me, using Ubuntu on WSL pasting the code via Windows Terminal, it's less prone to glitch.

Copy link

As I'm using ZSH, I added the small script from above to my .zshrc

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

But now I'm getting the following zsh error when it's initialising:

/home/user/.zshrc:157: defining function based on alias sudo' /home/user/.zshrc:157: parse error near ()'

Am I missing something?

Copy link

@Saidou83, seems unrelated. What your error says is that there is a error near parenthesis at the line 157 on your .zshrc

Try opening it on an editor with line counters (I know Kate and VSCode have them, not sure about a gnome alternative), then check what is in your line number 157.

Make sure you're pasting the code at the last line of your .zshrc to make sure you're not pasting between any other codes.

Copy link

I have the same issue as ThomasDalla and shoafer0 on Zorin 16. I think it has something to do with the version of Python, Zorin uses 3.8.

I then proceeded to install the latest Python 3.10 using the official "parallel installation" procedure, but that just lead me down the rabbit hole to a new problem with missing apt_pkg. Funny how there are always problems with Python, it's a card house.

Which Linux distro and version is this supposed to work on?

Copy link

Someone reported the same problem on the project gitlab page, and later updated with the solution "EDIT: I added the Universe repo on my computer. Works like a charm.".

on my system it reports "'universe' distribution component is already enabled for all sources." and I still get the same error so I don't know. Frustrating. No wonder Linux is struggling to get market share on the desktop.

Copy link

I used this as my following alias in zshrc. after restarting terminal or typing "source ~/.zshrc"
it was working fine.

alias sudo="sudo "
alias apt="nala"

Copy link

I've been using Nala for some time on several Pi4's and an older Ubuntu machine. But for the life of me, I can NOT get it to run on a Pi Zero W.

@lymond6
Copy link

lymond6 commented Jul 7, 2023

I realize this is an older thread, but I have a comment. For those recommending using nala in place of apt or apt-get (yes these differ), I have one question. I find nala very pretty, but please tell me if you know how to install a package from backports with nala. the -t bookworm-backports argument does not function in nala as it does in apt/apt-get. I'd really like to find this info.

Copy link

scifi-engr commented Oct 9, 2023

I run piHole on Debian 11 in a LXC on Proxmox VE 8.0.4; In addition to the above instructions I needed to add 2 export commands to my .bashrc file, in order for nala to work correctly.

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

Copy link

froeb commented Nov 22, 2023

works perfect for me under LMDE6 (using debian 12), nala is directly in the repos.

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