Score:1

จะรับ Bleachbit เวอร์ชันล่าสุดด้วย wget ใน bash ได้อย่างไร

ธง tr

ในการรับ 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 อย่างเป็นทางการ (ด้วย ฉลาดรับ bleachbit) มีการติดตั้งเวอร์ชันเก่าซึ่งมีข้อผิดพลาดในการติดตั้ง และ ตามที่ผู้สร้างเครื่องมือนี้:

Ubuntu มีนโยบาย "ไม่มีการเผยแพร่" ดังนั้นพื้นที่เก็บข้อมูลของ Ubuntu จะไม่อัปเดตด้วยเวอร์ชันล่าสุด

เนื่องจากเครื่องมือนี้มีการอัปเดตเป็นประจำ ฉันจึงต้องการดาวน์โหลดเวอร์ชันล่าสุดเสมอ ดังนั้นฉันจึงทุบตีนี้ แต่มันไม่ทำงาน:

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 | หาง -1)
--2021-11-10 10:24:50-- http://packages.linuxmint.com/pool/main/m/mintstick/
แก้ไข package.linuxmint.com (packages.linuxmint.com)... 208.77.20.11, 68.235.39.11
เชื่อมต่อกับ package.linuxmint.com (packages.linuxmint.com)[208.77.20.11]:80... เชื่อมต่อ
Petición HTTP enviada, esperando respuesta... 200 ตกลง
ความยาว: 10112 (9,9K) [text/html]
Guardando como: âSTDOUTâ

- 100%[===================>] 9,88K --.-KB/s ใน 0 วินาที      
2021-11-10 10:24:51 (191 MB/s) - ขยายเป็นมาตรฐาน [10112/10112]

คำสั่งเอาท์พุท:

wget -c https://www.bleachbit.org"$lastbleachbit"
--2021-11-10 10:26:39-- https://www.bleachbit.org/
แก้ไข www.bleachbit.org (www.bleachbit.org)... 172.67.129.101, 104.21.1.137, 2606:4700:3030::ac43:8165, ...
เชื่อมต่อกับ www.bleachbit.org (www.bleachbit.org)[172.67.129.101]:443... เชื่อมต่อ
Petición HTTP enviada, esperando respuesta... 200 ตกลง
ความยาว: ไม่มีคำอธิบายเฉพาะ [text/html]
Guardando como: âindex.htmlâ

index.html [ <=> ] 10,93K --.-KB/s และ 0,002 วินาที  

2021-11-10 10:26:40 (4,38 MB/s) - âindex.htmlâ การ์ดาโด [11193]

ฉันทำอะไรผิด?

ar flag
สิ่งนี้ตอบคำถามของคุณหรือไม่ [เหตุใดที่เก็บ Ubuntu จึงไม่มีซอฟต์แวร์เวอร์ชันล่าสุด](https://askubuntu.com/questions/151283/why-dont-the-ubuntu-repositories-have-the-latest-versions-of-software )
acgbox avatar
tr flag
@ user68186 ไม่ ตามที่ผู้สร้างเครื่องมือนี้: Ubuntu มีนโยบาย "ไม่มีการเผยแพร่" https://github.com/bleachbit/bleachbit/issues/1277#issuecomment-932959861
muru avatar
us flag
คุณได้ตรวจสอบเนื้อหาของตัวแปร `lastbleachbit` แล้วหรือยัง?
acgbox avatar
tr flag
@muru อัปเดตคำถามพร้อมเอาต์พุต
Score:2
ธง sd

คุณหายไป /ลินุกซ์.

$ 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 | เรียง -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
กำลังแก้ไข download.bleachbit.org (download.bleachbit.org)... 172.67.129.101, 104.21.1.137, 2606:4700:3035::6815:189, ...
กำลังเชื่อมต่อกับ download.bleachbit.org (download.bleachbit.org)|172.67.129.101|:443... เชื่อมต่อแล้ว
ส่งคำขอ HTTP แล้ว กำลังรอการตอบกลับ... 200 ตกลง
ความยาว: 441432 (431K) [ใบสมัคร/x-deb]
กำลังบันทึกไปที่: âbleachbit_4.4.0-0_all_ubuntu2004.debâ

bleachbit_4.4.0-0_all_ubuntu2004 100%[================================================ ============>] 431.09K 2.02MB/s ใน 0.2 วินาที    

2021-11-10 16:01:11 (2.02 MB/s) - âbleachbit_4.4.0-0_all_ubuntu2004.debâ บันทึกแล้ว [441432/441432]

ฉันคิดว่ามันน่าจะใช้ได้ตราบเท่าที่หน้าดาวน์โหลดยังคงมีลิงก์ฝังอยู่ .deb แม้ว่าฉันจะไม่รู้ว่านานแค่ไหนแล้วที่ฉันไม่เคยใช้ bleachbit

acgbox avatar
tr flag
สุดยอดมาก ขอบใจ

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา