AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1374738
Accepted
acgbox
acgbox
Asked: 2021-11-11 06:59:23 +0800 CST2021-11-11 06:59:23 +0800 CST 2021-11-11 06:59:23 +0800 CST

如何始终在 bash 中使用 wget 获取最新版本的 Bleachbit?

  • 772

要获取最新版本的 BleachBit(适用于 Ubuntu 20.04),我们可以使用以下命令:

wget -c https://download.bleachbit.org/bleachbit_4.4.0-0_all_ubuntu2004.deb -O bleachbit.deb
dpkg -i bleachbit.deb

如果我们从官方 Ubuntu 存储库(带有apt-get bleachbit)安装它,则会安装旧版本,其中包含安装错误。根据该工具的创建者的说法:

Ubuntu 有“不滚动发布”政策,因此 Ubuntu 存储库不会更新为最新版本

由于此工具会定期更新,因此我希望始终下载最新版本。所以我做了这个bash,但它不起作用:

lastbleachbit=$(wget -O - https://www.bleachbit.org/download/ | grep -Po '/download/file/([^"]+)' | grep ubuntu2004 | sort -u)
wget -c https://www.bleachbit.org"$lastbleachbit" -O bleachbit.deb
dpkg -i bleachbit.deb

输出变量:

lastmintstick=$(wget -O - http://packages.linuxmint.com/pool/main/m/mintstick/ | grep -Po 'href=".*?"' | sed -r 's:href\="(.*)":\1:' | grep ".deb" | sort | tail -1)
--2021-11-10 10:24:50--  http://packages.linuxmint.com/pool/main/m/mintstick/
Resolviendo packages.linuxmint.com (packages.linuxmint.com)... 208.77.20.11, 68.235.39.11
Conectando con packages.linuxmint.com (packages.linuxmint.com)[208.77.20.11]:80... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 10112 (9,9K) [text/html]
Guardando como: “STDOUT”

-                   100%[===================>]   9,88K  --.-KB/s    en 0s      
2021-11-10 10:24:51 (191 MB/s) - escritos a stdout [10112/10112]

输出命令:

wget -c https://www.bleachbit.org"$lastbleachbit"
--2021-11-10 10:26:39--  https://www.bleachbit.org/
Resolviendo www.bleachbit.org (www.bleachbit.org)... 172.67.129.101, 104.21.1.137, 2606:4700:3030::ac43:8165, ...
Conectando con www.bleachbit.org (www.bleachbit.org)[172.67.129.101]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: no especificado [text/html]
Guardando como: “index.html”

index.html              [ <=>                ]  10,93K  --.-KB/s    en 0,002s  

2021-11-10 10:26:40 (4,38 MB/s) - “index.html” guardado [11193]

我做错了什么?

apt
  • 1 1 个回答
  • 231 Views

1 个回答

  • Voted
  1. Best Answer
    Liso
    2021-11-11T07:36:48+08:002021-11-11T07:36:48+08:00

    你不见了/linux。

    $ lastbleachbit=$(wget --quiet -O - https://www.bleachbit.org/download/linux | grep -Po '/download/file/([^"]+)' | grep ubuntu2004 | sort -u)
    $ echo $lastbleachbit 
    /download/file/t?file=bleachbit_4.4.0-0_all_ubuntu2004.deb
    

    凭借我有限的 grep 知识,我设法让它工作。

    $ lastbleachbit=$(wget --quiet -O - https://www.bleachbit.org/download/linux | grep -Po '(?<=file=).*(?=">)' | grep ubuntu2004 | sort -u)
    $ echo $lastbleachbit 
    bleachbit_4.4.0-0_all_ubuntu2004.deb
    

    当你下载它。

    $ wget "https://download.bleachbit.org/${lastbleachbit}"
    --2021-11-10 16:01:10--  https://download.bleachbit.org/bleachbit_4.4.0-0_all_ubuntu2004.deb
    Resolving download.bleachbit.org (download.bleachbit.org)... 172.67.129.101, 104.21.1.137, 2606:4700:3035::6815:189, ...
    Connecting to download.bleachbit.org (download.bleachbit.org)|172.67.129.101|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 441432 (431K) [application/x-deb]
    Saving to: ‘bleachbit_4.4.0-0_all_ubuntu2004.deb’
    
    bleachbit_4.4.0-0_all_ubuntu2004. 100%[===========================================================>] 431.09K  2.02MB/s    in 0.2s    
    
    2021-11-10 16:01:11 (2.02 MB/s) - ‘bleachbit_4.4.0-0_all_ubuntu2004.deb’ saved [441432/441432]
    

    我认为只要下载页面继续嵌入包含.deb文件的链接,这应该可以工作,尽管我不知道我从不使用漂白比特多久。

    • 2

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve