Results 1 to 4 of 4

Thread: Need help scripting apt-get remove

  1. #1
    Member registered user
    Join Date
    Aug 2004
    Posts
    32

    Need help scripting apt-get remove

    I have started the remastering process working off the 5.3.1 DVD release. I know the packages I want to remove and have compiled them into a text file.
    I thought I would just make a simple bash script to remove them, but it always aborts after a few minutes with no real info as to why.

    Here is what I have:
    #!/bin/bash
    apt-get --force-yes --purge remove packagename


    If I run each command it works, but not in the script
    I have also tried:
    cat filewithnames.txt | xargs apt-get --force-yes --purge remove
    This ends with the following: "Do you want to continue? Y/n Abort"


    Same issue.


    For the record, there are approx. 2500 packages that I want to remove. Is there a hard limit?

  2. #2
    Senior Member registered user
    Join Date
    Oct 2003
    Location
    N42.41 W73 and change
    Posts
    401
    Since apt is a front end for dpkg, I wonder if using dpkg itself might work better.

  3. #3
    Member registered user
    Join Date
    Aug 2004
    Posts
    32
    If I script like so:

    #!/bin/bash
    dpkg -r packname
    and so on

    It just throws bad interpeter errors

  4. #4
    Senior Member registered user
    Join Date
    Nov 2003
    Posts
    203
    When you run the script

    #!/bin/bash
    apt-get --force-yes --purge remove packagename

    What exactly is the message that you get? I don't remember whether apt-get requires confirmation in this syntax. If it does you may have to redirect standard input to the script itself for each invocation and provide the yes/no response there.

    cmd << text

    The contents of the shell script up to a line identical to text become the standard input for cmd.

Similar Threads

  1. what's the printer configuration using shell scripting?
    By triple_play45 in forum Hardware & Booting
    Replies: 0
    Last Post: 02-24-2006, 03:34 AM
  2. Scripting Dynamic Partitions?
    By lorddecker in forum Customising & Remastering
    Replies: 3
    Last Post: 02-17-2005, 10:09 PM
  3. how do i remove....SBM........
    By cpc in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 01-02-2005, 07:05 PM
  4. how to remove a packae without using apt-get remove?
    By DimGR in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 06-09-2004, 05:34 PM
  5. How to remove KDE and reinstall KDE 3.1.5?
    By Paradox in forum Hdd Install / Debian / Apt
    Replies: 9
    Last Post: 02-06-2004, 09:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Genuine Cisco SFP-10G-SR 0-2415-03 10 Gigabit Transceiver picture

Genuine Cisco SFP-10G-SR 0-2415-03 10 Gigabit Transceiver

$5.40



Dell Intel X710-DA2 5N7Y5 Dual-Port 10GbE SFP+ PCIe 3.0 x8 Network Adapter picture

Dell Intel X710-DA2 5N7Y5 Dual-Port 10GbE SFP+ PCIe 3.0 x8 Network Adapter

$27.50



Cisco Acacia DP04QSDD-E25-840 400G QSFP-DD Coherent DCO Transceiver Module picture

Cisco Acacia DP04QSDD-E25-840 400G QSFP-DD Coherent DCO Transceiver Module

$699.99



NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping* picture

NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping*

$24.00



HPE 10/25GbE 2Port SFP28 Intel E810 OCP3 Network Adapter NIC 2 Port 10G 25G 25GE picture

HPE 10/25GbE 2Port SFP28 Intel E810 OCP3 Network Adapter NIC 2 Port 10G 25G 25GE

$609.00



SFP TO RJ45 TRANSCEIVER SFP MODULE COPPER SFP OPTICAL PORT TO RJ45 ETHERNET PORT picture

SFP TO RJ45 TRANSCEIVER SFP MODULE COPPER SFP OPTICAL PORT TO RJ45 ETHERNET PORT

$7.99



Intel X520-DA2 10Gb 10Gbe 10 Gigabit Network Adapter NIC Dual Port E10G42BTDA picture

Intel X520-DA2 10Gb 10Gbe 10 Gigabit Network Adapter NIC Dual Port E10G42BTDA

$28.94



HP 560SFP+ 10GB 2-port  PCIe NIC Ethernet ADAPTER 669279-001 w/ (2) 10GB SFP+ picture

HP 560SFP+ 10GB 2-port PCIe NIC Ethernet ADAPTER 669279-001 w/ (2) 10GB SFP+

$16.99



CISCO 10GBASE-SR SFP

CISCO 10GBASE-SR SFP "Lot of 4” SFP-10G-SR

$47.99



HPE P10109-B21 MCX512F-ACAT 10/25GbE Dual-Port SFP28 NIC P10107-001 P12608-001 picture

HPE P10109-B21 MCX512F-ACAT 10/25GbE Dual-Port SFP28 NIC P10107-001 P12608-001

$100.00