ChrisTitusTech / website

My HUGO Website that I use for Videos, Blogs, and Redirects
82 stars 43 forks source link

stop-using-apt/ #16

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Stop Using APT

Having Fun with Technology

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

cris1 commented 2 years ago

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.

DonnyBahama commented 2 years ago

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

callisto012 commented 2 years ago

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

SvenMazet commented 2 years ago

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 commented 2 years ago

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.

TheDarkStarUK commented 2 years ago

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

tacogerbil commented 2 years ago

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

C-Keenan commented 2 years ago

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 commented 2 years ago

just saw the fetch error comment someone else left lol

timnolte commented 2 years ago

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.

Twixtfanatic commented 2 years ago

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.

zamostny commented 2 years ago

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.
silverskymedia commented 2 years ago

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

LeonvanHeerden commented 2 years ago

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

goldyard commented 2 years ago

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.

ChrisTitusTech commented 2 years ago

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

LeonvanHeerden commented 2 years ago

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.

franciscocastro54 commented 2 years ago

Thanks, it's very useful

olivertzeng commented 2 years ago

Hope it supports Arch Linux's AUR helper.

aphive commented 2 years ago

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 commented 2 years ago

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

subnerf commented 2 years ago

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

ThomasDalla commented 2 years ago

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
kresike commented 2 years ago

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

shoafer0 commented 2 years ago

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.

RaymondDay61 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Thank you! I actually figured that out a few minutes before you posted this but hopefully this will be helpful for other people (because when I searched that output I found this thread!)

On Sat, Jul 30, 2022, 19:49 Tim Nolte @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/ChrisTitusTech/website/issues/16#issuecomment-1200264781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJ4S6KTFVE4JLMRCPBBBKTVWVTL3ANCNFSM54D7VYQA . You are receiving this because you commented.Message ID: @.***>

BrokenAnsible commented 2 years ago

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!

subnerf commented 2 years ago

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]

7331Squall commented 2 years ago

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.

Saidou83 commented 2 years ago

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?

7331Squall commented 2 years ago

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

Waldorf3 commented 1 year ago

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?

Waldorf3 commented 1 year ago

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.

Taaseen71 commented 1 year ago

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"

JackHenry59 commented 1 year ago

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 commented 1 year ago

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.

scifi-engr commented 11 months ago

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

froeb commented 10 months ago

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

Bonez0r commented 2 months ago

Beginning linux user here. I'm trying to follow instructions at https://christitus.com/stop-using-apt/ but the scar.key file seems to no longer exist at http://deb.volian.org/volian/, but there is a nala.key file in that same location. Should the instructions be updated? I assume the filename has to be changed, but what about the rest of the command line? As I said i'm just a beginner.

lymond6 commented 2 months ago

I do not know how I got subscribed, nor why I have no password listed if I did it; is there a mechanism by which we can unsubscribe me, or need I resort to more formal means?

On Tue, Jul 2, 2024 at 7:03 AM Bonez0r @.***> wrote:

Beginning linux user here. I'm trying to follow instructions at https://christitus.com/stop-using-apt/ but the scar.key file seems to no longer exist at http://deb.volian.org/volian/, but there is a nala.key file in that same location. Should the instructions be updated? I assume the filename has to be changed, but what about the rest of the command line? As I said i'm just a beginner.

— Reply to this email directly, view it on GitHub https://github.com/ChrisTitusTech/website/issues/16#issuecomment-2202988763, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSCVX32VZHZE7PK77K2SRDZKKJJ7AVCNFSM6AAAAABKHM4ECGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBSHE4DQNZWGM . You are receiving this because you commented.Message ID: @.***>

--

Steven Zanvil Sawolkin (I/me/mine) phone: 515-223-8086 and Janette R. Gerdes (she/her/hers) email: @. 1620 Vine St., Apt. 101 alternate email: @. West Des Moines, IA USA 50265-4327 alternate email: @.***

QUOTE OF THE WEEK:

"Plato, in his "Apology" attributes to Socrates the phrase "the unexamined life is not worth living". It seems to me that the trouble these days is that, in too many cases, neither is the examined life." -- Steven Zanvil Sawolkin

Bonez0r commented 2 months ago

I do not know how I got subscribed, nor why I have no password listed if I did it; is there a mechanism by which we can unsubscribe me, or need I resort to more formal means?

If you scroll to the top of this page (https://github.com/ChrisTitusTech/website/issues/16), there is an unsubscribe button just above the list of participants.

Never mind, I see you reponded via email. I have no idea how to unsubscribe without logging in.

lymond6 commented 2 months ago

Thank you. I find the security model odd, because the subscribe link at the bottom requires a password, but the top link seems not to do. My old pals at the so-called "alphabet agencies" would be bemused. Thank you again.

On Tue, Jul 2, 2024 at 7:14 AM Bonez0r @.***> wrote:

I do not know how I got subscribed, nor why I have no password listed if I did it; is there a mechanism by which we can unsubscribe me, or need I resort to more formal means?

If you scroll to the top of this page (#16 https://github.com/ChrisTitusTech/website/issues/16), there is an unsubscribe button just above the list of participants.

— Reply to this email directly, view it on GitHub https://github.com/ChrisTitusTech/website/issues/16#issuecomment-2203008432, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSCVXZHMH3M7HZU7MTR5DLZKKKRZAVCNFSM6AAAAABKHM4ECGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBTGAYDQNBTGI . You are receiving this because you commented.Message ID: @.***>

--

Steven Zanvil Sawolkin (I/me/mine) phone: 515-223-8086 and Janette R. Gerdes (she/her/hers) email: @. 1620 Vine St., Apt. 101 alternate email: @. West Des Moines, IA USA 50265-4327 alternate email: @.***

QUOTE OF THE WEEK:

"Plato, in his "Apology" attributes to Socrates the phrase "the unexamined life is not worth living". It seems to me that the trouble these days is that, in too many cases, neither is the examined life." -- Steven Zanvil Sawolkin

madmonkey71 commented 2 months ago

It would appear that the filename for the key has changed to nala.key so the new command line to get the keys is now.

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