Code Monkey home page Code Monkey logo

update's Introduction

logo update2deb

update

update is a small script that updates apps from Apt, Pi-Apps, Flatpak, Homebrew, NPM, and the Snap Store, a.k.a. snapd.

Install

curl -s "https://raw.githubusercontent.com/Crilum/update/main/install" | bash

This should work for most systems (Apt-based distros (not Alpine Linux, yet..), DNF-based distros, most other Linux distros, and MacOS). If it doesn't work on your system, create an issue (or even better, a PR), and I'll try to help.

If you want to install manually | click to expand

There are two different ways to download the script, the first one is easier, but you can use the second one if you want.

Method 1. Use `wget` and download `update` directly, and copy the script to `/usr/local/bin/`:

  1. Make sure wget is installed:

    sudo apt install wget
    
  2. Download the latest version of update with wget:

    version="$(curl -s https://api.github.com/repos/Crilum/update/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
    wget "https://github.com/Crilum/update/raw/v${version}/update"
    
  3. Move update to /usr/local/bin/:

    sudo mv update /usr/local/bin/update
    
  4. Make update executable:

    sudo chmod +x /usr/local/bin/update
    

Method 2. Use `git clone` and copy the script to `/usr/local/bin/`:

  1. Clone the latest release of the repository:

    version="$(curl -s https://api.github.com/repos/Crilum/update/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
    git clone https://github.com/Crilum/update/ -b $version
    
  2. Or, if you have GitHub CLI:

    version="$(curl -s https://api.github.com/repos/Crilum/update/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')"
    gh repo clone Crilum/update -- -b $version
    
  3. Copy the Update Script to /usr/local/bin/:

    cd update && sudo cp update /usr/local/bin/update
    
  4. Make it executable:

    sudo chmod +x /usr/local/bin/update
    
  5. Remove the cloned repository (This is optional):

    rm -rf update/
    

Uninstall

Just uninstall the package:

Apt based distros:

sudo apt remove update

Or, if your system doesn't have an update package:

Other linux:

sudo rm -f /usr/bin/update /usr/bin/up

MacOS:

sudo rm -f /usr/local/bin/update /usr/local/bin/up

and you're done!

Usage

You can use update like this:

These are the main options/arguments for update:

update apt · -a · --apt [packages]         Updates apt packages
update all · -A · --all                    Updates apps on all installed package managers and/or app stores that are supported - Note: This option does not update NPM packages because this can cause trouble.
update pi-apps · -p · --pi-apps            Updates Pi-Apps, and apps installed with Pi-Apps
update npm · -n · --npm                    Updates all npm packages
update snaps · -s · --snaps [snaps]        Updates snaps with snapd
update flatpak · -f · --flatpak [packages] Updates flatpak apps
update homebrew · -H · --homebrew          Updates Homebrew apps
update pacman · -c · --pacman [packages]   Updates pacman apps
update dnf · -d · --dnf                    Updates dnf packages
update self-update · -u · --self-update    Updates the update script
update help · -h · --help                  Displays this help
update version · -v · --version            Prints version

Flags for update:

      --no-grep-args                       If this flag is specified, update won't remove arguments that are also packages from the update package list, i.e. 'apt'

Todo

  • make a unified install script.
  • Make a Releases tesing system, so when I release an update GitHub Actions tests installation.
  • Create Contributing.md.
  • Create pull request templates.
  • Create a editable configuration for all argument
  • Create a more reliable way to check for updates that doesn't depend on a variable in the script, or modify update2deb to edit the script and set the right version.
  • Make install uninstall update if it's already installed

update's People

Contributors

antonvanassche avatar crilum avatar ryanfortner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

update's Issues

`update -h` and `update -v` make the Bash prompt appear in bold.

Describe the bug
Running the script with the -h flag to display the help message will make the Bash prompt appear in bold as well. The same happens when using the -v flag to display the version number.

To Reproduce
Steps to reproduce the behavior:

  1. Execute ./update -h
  2. Execute ./update -v

Expected behavior
Shows the help message and the version number without changing the Bash prompt.

Screenshots
Screenshot from 2022-06-23 18-36-03
Screenshot from 2022-06-23 18-36-29

System information:

  • OS: Fedora Linux (36)
  • Version: v1.3.9

Additional context
I suspect there is a few ${NC} missing in the code.
I can make a pull request to resolve this if you'd like.

PI-apps error when running update all

Pi-Apps output:
/home/pi/Downloads/update/update: line 63: /root/pi-apps/updater: No such file or directory

Distro: Raspberry Pi OS base: Debian GNU/Linux bookworm/sid
Host: Raspberry Pi 400 Rev 1.0
Kernel: 5.15.4-v8+
Shell: bash 5.1.8

Pacman -Syyu

-Syyu should NOT be used unless there is a reason for it.

Use sudo pacman -Syu

Explicit Explanation

It forces the server to fetch the package lists fully, putting strain on the servers

`rpm` package conflicts with `filesystem-3.16-2.fc36.x86_64`

Describe the bug
When I try to install update using the provided rpm file on the releases page, I get the following error.

$ doas dnf install ./update-1.4.1-2.noarch.rpm 
Last metadata expiration check: 0:02:01 ago on Tue Jun 28 21:24:21 2022.
Dependencies resolved.
==========================================================================================================================
 Package                    Architecture               Version                     Repository                        Size
==========================================================================================================================
Installing:
 update                     noarch                     1.4.0-2                     @commandline                      11 k

Transaction Summary
==========================================================================================================================
Install  1 Package

Total size: 11 k
Installed size: 14 k
Is this ok [Y/n]: 
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction test error:
  file /usr/bin from install of update-1.4.0-2.noarch conflicts with file from package filesystem-3.16-2.fc36.x86_64

To Reproduce
Steps to reproduce the behavior:

  1. wget https://github.com/Crilum/update/releases/download/v1.4.1/update-1.4.1-2.noarch.rpm
  2. doas dnf install ./update-1.4.1-2.noarch.rpm (you can also use sudo)

Expected behavior
doas dnf install ./update-1.4.1-2.noarch.rpm installs update without any issues.

Desktop (please complete the following information):

  • OS: Fedora Linux (36)
  • Version v1.4.1

Additional context
I suspect the method for packaging the program for DNF based distributions isn't quite right.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.