> For the complete documentation index, see [llms.txt](https://avbravo-2.gitbook.io/trucosjakartaee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avbravo-2.gitbook.io/trucosjakartaee/overview/ubuntu.md).

# Ubuntu

## Ubuntu

Crear un .deb

Fuente

<https://ubuntulife.wordpress.com/2010/08/05/crear-un-paquete-deb-manualmente/>

### Crear el archivo .sh

![](/files/-Lc1X8jZ5wN-cDhn3e2g)

### Codigo

```java
#!/bin/bash
DIA=`date +"%Y_%m_%d"`
HORA=`date +"_%H_%M"`
menu = "v"
continue="si"
while [ "$continue" == "si" ]
do
  clear
#
echo "--------------------------------------------"
echo " v) Ver trabajos en cola"
echo " e) Eliminar "
echo " s) Salir"
read menu
if [ "$menu" == "v" ] || [ "$menu" == "V" ]; then
    #realiza respaldos de MongoDB
        echo "-----------------------------------------------"
    echo 'Ver trabajos en cola'
    echo "-----------------------------------------------"


             lpq

    echo "-----------------------------------------------"
        echo "presione una tecla"
        read tecla

else
      if [ "$menu" == "e" ] || [ "$menu" == "E" ]; then
        #realiza respaldos de MongoDB
        echo "-----------------------------------------------"
        echo 'Eliminar trabajos de cola impresion'
        echo "-----------------------------------------------"
                lprm -

                echo "presione una tecla"
                read tecla
    else
                 if [ "$menu" == "s" ] || [ "$menu" == "S" ]; then
continue="no"
                 else
               echo "Opcion invalida (b/r/s)"
                   echo "presione una tecla"
                   read tecla
                 fi

    fi

fi

done
```

## Crear un directorio deb

```java
cd Descargas
mkdir deb
# crear direcrtorio /usr/bin
mkdir -p ./deb/usr/bin
```

**#Copiar el archivo .sh al directorio ./deb/usr/bin**

```java
cp impresora.sh ./deb/usr/bin
```

![](/files/-Lc1X8jaD0cceXOV4lwm)

**Crear directorio DEBIAN**

```
mkdir ./deb/DEBIAN
```

### ![](/files/-Lc1X8jcnSC0OcO897Uz)

### Crear el archivo control dentro de DEBIAN

```
Package: SCRIPTS
Priority: optional
Section: misc
Maintainer:avbravo
Architecture: all
Version: 1.0
Depends:
Description: Controla los trabajos de la impresora
```

### Dar permisos

```
sudo chown -R root.root ./deb
```

### Crear el paquete deb

```
dpkg -b ./deb /home/avbravo/Descargas/impresoras.deb
```

### Instalar el .deb

```
 sudo dpkg -i impresoras.deb
```

### Una vez instalado podemos ejecutarlo desde cualquier sitio

```
impresora.sh
```

![](/files/-Lc1X8jeOA5h5BwB95Sd)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avbravo-2.gitbook.io/trucosjakartaee/overview/ubuntu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
